home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr54 / bison118.zip / TEXINFO.TEX (.txt) < prev    next >
LaTeX Document  |  1993-06-01  |  111KB  |  2,654 lines

  1. %% TeX macros to handle texinfo files
  2. %   Copyright (C) 1985, 1986, 1988, 1990, 1991 Free Software Foundation, Inc.
  3. %This texinfo.tex file is free software; you can redistribute it and/or
  4. %modify it under the terms of the GNU General Public License as
  5. %published by the Free Software Foundation; either version 2, or (at
  6. %your option) any later version.
  7. %This texinfo.tex file is distributed in the hope that it will be
  8. %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  9. %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  10. %General Public License for more details.
  11. %You should have received a copy of the GNU General Public License
  12. %along with this texinfo.tex file; see the file COPYING.  If not, write
  13. %to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
  14. %USA.
  15. %In other words, you are welcome to use, share and improve this program.
  16. %You are forbidden to forbid anyone else to use, share and improve
  17. %what you give them.   Help stamp out software-hoarding!
  18. \def\texinfoversion{2.70}
  19. \message{Loading texinfo package [Version \texinfoversion]:}
  20. \message{}
  21. % Print the version number if in a .fmt file.
  22. \everyjob{\message{[Texinfo version \texinfoversion]}\message{}}
  23. % Save some parts of plain tex whose names we will redefine.
  24. \let\ptexlbrace=\{
  25. \let\ptexrbrace=\}
  26. \let\ptexdots=\dots
  27. \let\ptexdot=\.
  28. \let\ptexstar=\*
  29. \let\ptexend=\end
  30. \let\ptexbullet=\bullet
  31. \let\ptexb=\b
  32. \let\ptexc=\c
  33. \let\ptexi=\i
  34. \let\ptext=\t
  35. \let\ptexl=\l
  36. \let\ptexL=\L
  37. \def\tie{\penalty 10000\ }     % Save plain tex definition of ~.
  38. \message{Basics,}
  39. \chardef\other=12
  40. \hyphenation{ap-pen-dix}
  41. \hyphenation{mini-buf-fer mini-buf-fers}
  42. \hyphenation{eshell}
  43. % Margin to add to right of even pages, to left of odd pages.
  44. \newdimen \bindingoffset  \bindingoffset=0pt
  45. \newdimen \normaloffset   \normaloffset=\hoffset
  46. \newdimen\pagewidth \newdimen\pageheight
  47. \pagewidth=\hsize \pageheight=\vsize
  48. % Sometimes it is convenient to have everything in the transcript file
  49. % and nothing on the terminal.  We don't just call \tracingall here,
  50. % since that produces some useless output on the terminal.
  51. \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
  52. \def\loggingall{\tracingcommands2 \tracingstats2 
  53.    \tracingpages1 \tracingoutput1 \tracinglostchars1 
  54.    \tracingmacros2 \tracingparagraphs1 \tracingrestores1 
  55.    \showboxbreadth\maxdimen\showboxdepth\maxdimen
  56. %---------------------Begin change-----------------------
  57. %%%% For @cropmarks command.
  58. % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
  59. \newdimen\cornerlong \newdimen\cornerthick
  60. \newdimen \topandbottommargin
  61. \newdimen \outerhsize \newdimen \outervsize
  62. \cornerlong=1pc\cornerthick=.3pt    % These set size of cropmarks
  63. \outerhsize=7in
  64. %\outervsize=9.5in
  65. % Alternative @smallbook page size is 9.25in
  66. \outervsize=9.25in
  67. \topandbottommargin=.75in
  68. %---------------------End change-----------------------
  69. % \onepageout takes a vbox as an argument.  Note that \pagecontents
  70. % does insertions itself, but you have to call it yourself.
  71. \chardef\PAGE=255  \output={\onepageout{\pagecontents\PAGE}}
  72. \def\onepageout#1{\hoffset=\normaloffset
  73. \ifodd\pageno  \advance\hoffset by \bindingoffset
  74. \else \advance\hoffset by -\bindingoffset\fi
  75. {\escapechar=`\\\relax % makes sure backslash is used in output files.
  76. \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
  77. {\let\hsize=\pagewidth \makefootline}}}%
  78. \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
  79. %%%% For @cropmarks command %%%%
  80. % Here is a modification of the main output routine for Near East Publications
  81. % This provides right-angle cropmarks at all four corners.
  82. % The contents of the page are centerlined into the cropmarks,
  83. % and any desired binding offset is added as an \hskip on either
  84. % site of the centerlined box.  (P. A. MacKay, 12 November, 1986)
  85. \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
  86.          \shipout
  87.          \vbox to \outervsize{\hsize=\outerhsize
  88.                  \vbox{\line{\ewtop\hfill\ewtop}}
  89.                  \nointerlineskip
  90.                  \line{\vbox{\moveleft\cornerthick\nstop}
  91.                        \hfill
  92.                        \vbox{\moveright\cornerthick\nstop}}
  93.                  \vskip \topandbottommargin
  94.                  \centerline{\ifodd\pageno\hskip\bindingoffset\fi
  95.             \vbox{
  96.             {\let\hsize=\pagewidth \makeheadline}
  97.             \pagebody{#1}
  98.             {\let\hsize=\pagewidth \makefootline}}
  99.             \ifodd\pageno\else\hskip\bindingoffset\fi}
  100.          \vskip \topandbottommargin plus1fill minus1fill
  101.                  \boxmaxdepth\cornerthick
  102.                  \line{\vbox{\moveleft\cornerthick\nsbot}
  103.                        \hfill
  104.                        \vbox{\moveright\cornerthick\nsbot}}
  105.                  \nointerlineskip
  106.                  \vbox{\line{\ewbot\hfill\ewbot}}
  107.   \advancepageno 
  108.   \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
  109. % Do @cropmarks to get crop marks
  110. \def\cropmarks{\let\onepageout=\croppageout }
  111. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  112. {\catcode`\@ =11
  113. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  114. \dimen@=\dp#1 \unvbox#1
  115. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  116. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  117. % Here are the rules for the cropmarks.  Note that they are
  118. % offset so that the space between them is truly \outerhsize or \outervsize
  119. % (P. A. MacKay, 12 November, 1986)
  120. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  121. \def\nstop{\vbox
  122.   {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  123. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  124. \def\nsbot{\vbox
  125.   {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  126. % Parse an argument, then pass it to #1.
  127. % The argument can be delimited with [...] or with "..." or braces
  128. % or it can be a whole line.
  129. % #1 should be a macro which expects
  130. % an ordinary undelimited TeX argument.
  131. \def\parsearg #1{\let\next=#1\begingroup\obeylines\futurelet\temp\parseargx}
  132. \def\parseargx{%
  133. \ifx \obeyedspace\temp \aftergroup\parseargdiscardspace \else%
  134. \aftergroup \parseargline %
  135. \fi \endgroup}
  136. {\obeyspaces %
  137. \gdef\parseargdiscardspace {\begingroup\obeylines\futurelet\temp\parseargx}}
  138. \gdef\obeyedspace{\ }
  139. \def\parseargline{\begingroup \obeylines \parsearglinex}
  140. {\obeylines %
  141. \gdef\parsearglinex #1^^M{\endgroup \next {#1}}}
  142. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  143. %% These are used to keep @begin/@end levels from running away
  144. %% Call \inENV within environments (after a \begingroup)
  145. \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
  146. \def\ENVcheck{%
  147. \ifENV\errmessage{Still within an environment.  Type Return to continue.}
  148. \endgroup\fi} % This is not perfect, but it should reduce lossage
  149. % @begin foo  is the same as @foo, for now.
  150. \newhelp\EMsimple{Type <Return> to continue}
  151. \outer\def\begin{\parsearg\beginxxx}
  152. \def\beginxxx #1{%
  153. \expandafter\ifx\csname #1\endcsname\relax
  154. {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
  155. \csname #1\endcsname\fi}
  156. %% @end foo executes the definition of \Efoo.
  157. %% foo can be delimited by doublequotes or brackets.
  158. \def\end{\parsearg\endxxx}
  159. \def\endxxx #1{%
  160. \expandafter\ifx\csname E#1\endcsname\relax
  161. \expandafter\ifx\csname #1\endcsname\relax
  162. \errmessage{Undefined command @end #1}\else
  163. \errorE{#1}\fi\fi
  164. \csname E#1\endcsname}
  165. \def\errorE#1{
  166. {\errhelp=\EMsimple \errmessage{@end #1 not within #1 environment}}}
  167. % Single-spacing is done by various environments.
  168. \newskip\singlespaceskip \singlespaceskip = \baselineskip
  169. \def\singlespace{%
  170. {\advance \baselineskip by -\singlespaceskip
  171. \kern \baselineskip}%
  172. \baselineskip=\singlespaceskip
  173. %% Simple single-character @ commands
  174. % @@ prints an @
  175. % Kludge this until the fonts are right (grr).
  176. \def\@{{\tt \char '100}}
  177. % Define @` and @' to be the same as ` and '
  178. % but suppressing ligatures.
  179. \def\`{{`}}
  180. \def\'{{'}}
  181. % Used to generate quoted braces.
  182. \def\mylbrace {{\tt \char '173}}
  183. \def\myrbrace {{\tt \char '175}}
  184. \let\{=\mylbrace
  185. \let\}=\myrbrace
  186. % @: forces normal size whitespace following.
  187. \def\:{\spacefactor=1000 }
  188. % @* forces a line break.
  189. \def\*{\hfil\break\hbox{}\ignorespaces}
  190. % @. is an end-of-sentence period.
  191. \def\.{.\spacefactor=3000 }
  192. % @w prevents a word break
  193. \def\w #1{\hbox{#1}}
  194. % @group ... @end group  forces ... to be all on one page.
  195. \def\group{\begingroup% \inENV ???
  196. \ifnum\catcode13=\active \else
  197. \errmessage{@group invalid in context where filling is enabled}\fi
  198. \def \Egroup{\egroup\endgroup}
  199. \vbox\bgroup}
  200. % @need space-in-mils
  201. % forces a page break if there is not space-in-mils remaining.
  202. \newdimen\mil  \mil=0.001in
  203. \def\need{\parsearg\needx}
  204. \def\needx#1{%
  205.   % Go into vertical mode, so we don't make a big box in the middle of a
  206.   % paragraph.
  207.   \par
  208.   % Don't add any leading before our big empty box, but allow a page
  209.   % break, since the best break might be right here.
  210.   \allowbreak
  211.   \nointerlineskip
  212.   \vtop to #1\mil{\vfil}%
  213.   % TeX does not even consider page breaks if a penalty added to the
  214.   % main vertical list is 10000 or more.  But in order to see if the
  215.   % empty box we just added fits on the page, we must make it consider
  216.   % page breaks.  On the other hand, we don't want to actually break the
  217.   % page after the empty box.  So we use a penalty of 9999.
  218.   % There is an extremely small chance that TeX will actually break the
  219.   % page at this \penalty, if there are no other feasible breakpoints in
  220.   % sight.  (If the user is using lots of big @group commands, which
  221.   % almost-but-not-quite fill up a page, TeX will have a hard time doing
  222.   % good page breaking, for example.)  However, I could not construct an
  223.   % example where a page broke at this \penalty; if it happens in a real
  224.   % document, then we can reconsider our strategy.
  225.   \penalty9999
  226.   % Back up by the size of the box, whether we did a page break or not.
  227.   \kern -#1\mil
  228.   % Do not allow a page break right after this kern.
  229.   \nobreak
  230. % @br   forces paragraph break
  231. \let\br = \par
  232. % @dots{}  output some dots
  233. \def\dots{$\ldots$}
  234. % @page    forces the start of a new page
  235. \def\page{\par\vfill\supereject}
  236. % @exdent text....
  237. % outputs text on separate line in roman font, starting at standard page margin
  238. % This records the amount of indent in the innermost environment.
  239. % That's how much \exdent should take out.
  240. \newskip\exdentamount
  241. % This defn is used inside fill environments such as @defun.
  242. \def\exdent{\parsearg\exdentyyy}
  243. \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
  244. % This defn is used inside nofill environments such as @example.
  245. \def\nofillexdent{\parsearg\nofillexdentyyy}
  246. \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
  247. \leftline{\hskip\leftskip{\rm#1}}}}
  248. %\hbox{{\rm#1}}\hfil\break}}
  249. % @include file    insert text of that file as input.
  250. \def\include{\parsearg\includezzz}
  251. \def\includezzz #1{{\def\thisfile{#1}\input #1
  252. \def\thisfile{}
  253. % @center line   outputs that line, centered
  254. \def\center{\parsearg\centerzzz}
  255. \def\centerzzz #1{{\advance\hsize by -\leftskip
  256. \advance\hsize by -\rightskip
  257. \centerline{#1}}}
  258. % @sp n   outputs n lines of vertical space
  259. \def\sp{\parsearg\spxxx}
  260. \def\spxxx #1{\par \vskip #1\baselineskip}
  261. % @comment ...line which is ignored...
  262. % @c is the same as @comment
  263. % @ignore ... @end ignore  is another way to write a comment
  264. \def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
  265. \parsearg \commentxxx}
  266. \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
  267. \let\c=\comment
  268. % Prevent errors for section commands.
  269. % Used in @ignore and in failing conditionals.
  270. \def\ignoresections{%
  271. \let\chapter=\relax
  272. \let\unnumbered=\relax
  273. \let\top=\relax
  274. \let\unnumberedsec=\relax
  275. \let\unnumberedsection=\relax
  276. \let\unnumberedsubsec=\relax
  277. \let\unnumberedsubsection=\relax
  278. \let\unnumberedsubsubsec=\relax
  279. \let\unnumberedsubsubsection=\relax
  280. \let\section=\relax
  281. \let\subsec=\relax
  282. \let\subsubsec=\relax
  283. \let\subsection=\relax
  284. \let\subsubsection=\relax
  285. \let\appendix=\relax
  286. \let\appendixsec=\relax
  287. \let\appendixsection=\relax
  288. \let\appendixsubsec=\relax
  289. \let\appendixsubsection=\relax
  290. \let\appendixsubsubsec=\relax
  291. \let\appendixsubsubsection=\relax
  292. \let\contents=\relax
  293. \let\smallbook=\relax
  294. \let\titlepage=\relax
  295. \def\ignore{\begingroup\ignoresections
  296. % Make sure that spaces turn into tokens that match what \ignorexxx wants.
  297. \catcode32=10
  298. \ignorexxx}
  299. \long\def\ignorexxx #1\end ignore{\endgroup\ignorespaces}
  300. \def\direntry{\begingroup\direntryxxx}
  301. \long\def\direntryxxx #1\end direntry{\endgroup\ignorespaces}
  302. % Conditionals to test whether a flag is set.
  303. \def\ifset{\begingroup\ignoresections\parsearg\ifsetxxx}
  304. \def\ifsetxxx #1{\endgroup
  305. \expandafter\ifx\csname IF#1\endcsname\relax \let\temp=\ifsetfail
  306. \else \let\temp=\relax \fi
  307. \temp}
  308. \def\Eifset{}
  309. \def\ifsetfail{\begingroup\ignoresections\ifsetfailxxx}
  310. \long\def\ifsetfailxxx #1\end ifset{\endgroup\ignorespaces}
  311. \def\ifclear{\begingroup\ignoresections\parsearg\ifclearxxx}
  312. \def\ifclearxxx #1{\endgroup
  313. \expandafter\ifx\csname IF#1\endcsname\relax \let\temp=\relax
  314. \else \let\temp=\ifclearfail \fi
  315. \temp}
  316. \def\Eifclear{}
  317. \def\ifclearfail{\begingroup\ignoresections\ifclearfailxxx}
  318. \long\def\ifclearfailxxx #1\end ifclear{\endgroup\ignorespaces}
  319. % @set foo     to set the flag named foo.
  320. % @clear foo   to clear the flag named foo.
  321. \def\set{\parsearg\setxxx}
  322. \def\setxxx #1{
  323. \expandafter\let\csname IF#1\endcsname=\set}
  324. \def\clear{\parsearg\clearxxx}
  325. \def\clearxxx #1{
  326. \expandafter\let\csname IF#1\endcsname=\relax}
  327. % Some texinfo constructs that are trivial in tex
  328. \def\iftex{}
  329. \def\Eiftex{}
  330. \def\ifinfo{\begingroup\ignoresections\ifinfoxxx}
  331. \long\def\ifinfoxxx #1\end ifinfo{\endgroup\ignorespaces}
  332. \long\def\menu #1\end menu{}
  333. \def\asis#1{#1}
  334. % @math means output in math mode.
  335. % We don't use $'s directly in the definition of \math because control
  336. % sequences like \math are expanded when the toc file is written.  Then,
  337. % we read the toc file back, the $'s will be normal characters (as they
  338. % should be, according to the definition of Texinfo).  So we must use a
  339. % control sequence to switch into and out of math mode.
  340. % This isn't quite enough for @math to work properly in indices, but it
  341. % seems unlikely it will ever be needed there.
  342. \let\implicitmath = $
  343. \def\math#1{\implicitmath #1\implicitmath}
  344. \def\node{\ENVcheck\parsearg\nodezzz}
  345. \def\nodezzz#1{\nodexxx [#1,]}
  346. \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
  347. \let\lastnode=\relax
  348. \def\donoderef{\ifx\lastnode\relax\else
  349. \expandafter\expandafter\expandafter\setref{\lastnode}\fi
  350. \let\lastnode=\relax}
  351. \def\unnumbnoderef{\ifx\lastnode\relax\else
  352. \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
  353. \let\lastnode=\relax}
  354. \def\appendixnoderef{\ifx\lastnode\relax\else
  355. \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
  356. \let\lastnode=\relax}
  357. \let\refill=\relax
  358. % @setfilename is done at the beginning of every texinfo file.
  359. % So open here the files we need to have open while reading the input.
  360. % This makes it possible to make a .fmt file for texinfo.
  361. \def\setfilename{%
  362.    \readauxfile
  363.    \opencontents
  364.    \openindices
  365.    \fixbackslash  % Turn off hack to swallow `\input texinfo'.
  366.    \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
  367.    \comment % Ignore the actual filename.
  368. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  369. \def\inforef #1{\inforefzzz #1,,,,**}
  370. \def\inforefzzz #1,#2,#3,#4**{See Info file \file{\losespace#3{}},
  371.   node \samp{\losespace#1{}}}
  372. \def\losespace #1{#1}
  373. \message{fonts,}
  374. % Font-change commands.
  375. % Texinfo supports the sans serif font style, which plain TeX does not.
  376. % So we set up a \sf analogous to plain's \rm, etc.
  377. \newfam\sffam
  378. \def\sf{\fam=\sffam \tensf}
  379. \let\li = \sf % Sometimes we call it \li, not \sf.
  380. %% Try out Computer Modern fonts at \magstephalf
  381. \let\mainmagstep=\magstephalf
  382. \ifx\bigger\relax
  383. \let\mainmagstep=\magstep1
  384. \font\textrm=cmr12
  385. \font\texttt=cmtt12
  386. \else
  387. \font\textrm=cmr10 scaled \mainmagstep
  388. \font\texttt=cmtt10 scaled \mainmagstep
  389. % Instead of cmb10, you many want to use cmbx10.
  390. % cmbx10 is a prettier font on its own, but cmb10
  391. % looks better when embedded in a line with cmr10.
  392. \font\textbf=cmb10 scaled \mainmagstep 
  393. \font\textit=cmti10 scaled \mainmagstep
  394. \font\textsl=cmsl10 scaled \mainmagstep
  395. \font\textsf=cmss10 scaled \mainmagstep
  396. \font\textsc=cmcsc10 scaled \mainmagstep
  397. \font\texti=cmmi10 scaled \mainmagstep
  398. \font\textsy=cmsy10 scaled \mainmagstep
  399. % A few fonts for @defun, etc.
  400. \font\defbf=cmbx10 scaled \magstep1 %was 1314
  401. \font\deftt=cmtt10 scaled \magstep1
  402. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
  403. % Fonts for indices and small examples.
  404. % We actually use the slanted font rather than the italic, 
  405. % because texinfo normally uses the slanted fonts for that.
  406. % Do not make many font distinctions in general in the index, since they
  407. % aren't very useful.
  408. \font\ninett=cmtt9
  409. \font\indrm=cmr9
  410. \font\indit=cmsl9
  411. \let\indsl=\indit
  412. \let\indtt=\ninett
  413. \let\indsf=\indrm
  414. \let\indbf=\indrm
  415. \let\indsc=\indrm
  416. \font\indi=cmmi9
  417. \font\indsy=cmsy9
  418. % Fonts for headings
  419. \font\chaprm=cmbx12 scaled \magstep2
  420. \font\chapit=cmti12 scaled \magstep2
  421. \font\chapsl=cmsl12 scaled \magstep2
  422. \font\chaptt=cmtt12 scaled \magstep2
  423. \font\chapsf=cmss12 scaled \magstep2
  424. \let\chapbf=\chaprm
  425. \font\chapsc=cmcsc10 scaled\magstep3
  426. \font\chapi=cmmi12 scaled \magstep2
  427. \font\chapsy=cmsy10 scaled \magstep3
  428. \font\secrm=cmbx12 scaled \magstep1
  429. \font\secit=cmti12 scaled \magstep1
  430. \font\secsl=cmsl12 scaled \magstep1
  431. \font\sectt=cmtt12 scaled \magstep1
  432. \font\secsf=cmss12 scaled \magstep1
  433. \font\secbf=cmbx12 scaled \magstep1
  434. \font\secsc=cmcsc10 scaled\magstep2
  435. \font\seci=cmmi12 scaled \magstep1
  436. \font\secsy=cmsy10 scaled \magstep2
  437. % \font\ssecrm=cmbx10 scaled \magstep1    % This size an font looked bad.
  438. % \font\ssecit=cmti10 scaled \magstep1    % The letters were too crowded.
  439. % \font\ssecsl=cmsl10 scaled \magstep1
  440. % \font\ssectt=cmtt10 scaled \magstep1
  441. % \font\ssecsf=cmss10 scaled \magstep1
  442. %\font\ssecrm=cmb10 scaled 1315    % Note the use of cmb rather than cmbx.
  443. %\font\ssecit=cmti10 scaled 1315    % Also, the size is a little larger than
  444. %\font\ssecsl=cmsl10 scaled 1315    % being scaled magstep1.
  445. %\font\ssectt=cmtt10 scaled 1315
  446. %\font\ssecsf=cmss10 scaled 1315
  447. %\let\ssecbf=\ssecrm
  448. \font\ssecrm=cmbx12 scaled \magstephalf
  449. \font\ssecit=cmti12 scaled \magstephalf
  450. \font\ssecsl=cmsl12 scaled \magstephalf
  451. \font\ssectt=cmtt12 scaled \magstephalf
  452. \font\ssecsf=cmss12 scaled \magstephalf
  453. \font\ssecbf=cmbx12 scaled \magstephalf
  454. \font\ssecsc=cmcsc10 scaled \magstep1 
  455. \font\sseci=cmmi12 scaled \magstephalf
  456. \font\ssecsy=cmsy10 scaled \magstep1
  457. % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
  458. % but that is not a standard magnification.
  459. % Fonts for title page:
  460. \font\titlerm = cmbx12 scaled \magstep3
  461. \let\authorrm = \secrm
  462. % In order for the font changes to affect most math symbols and letters,
  463. % we have to define the \textfont of the standard families.  Since
  464. % texinfo doesn't allow for producing subscripts and superscripts, we
  465. % don't bother to reset \scriptfont and \scriptscriptfont (which would
  466. % also require loading a lot more fonts).
  467. \def\resetmathfonts{%
  468.   \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
  469.   \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
  470.   \textfont\ttfam = \tentt \textfont\sffam = \tensf
  471. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  472. % of just \STYLE.  We do this so that font changes will continue to work
  473. % in math mode, where it is the current \fam that is relevant in most
  474. % cases, not the current.  Plain TeX does, for example,
  475. % \def\bf{\fam=\bffam \tenbf}  By redefining \tenbf, we obviate the need
  476. % to redefine \bf itself.  
  477. \def\textfonts{%
  478.   \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  479.   \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  480.   \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  481.   \resetmathfonts}
  482. \def\chapfonts{%
  483.   \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl 
  484.   \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  485.   \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  486.   \resetmathfonts}
  487. \def\secfonts{%
  488.   \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  489.   \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  490.   \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  491.   \resetmathfonts}
  492. \def\subsecfonts{%
  493.   \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  494.   \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  495.   \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  496.   \resetmathfonts}
  497. \def\indexfonts{%
  498.   \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
  499.   \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
  500.   \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy
  501.   \resetmathfonts}
  502. % Set up the default fonts, so we can use them for creating boxes.
  503. \textfonts
  504. % Count depth in font-changes, for error checks
  505. \newcount\fontdepth \fontdepth=0
  506. % Fonts for short table of contents.
  507. \font\shortcontrm=cmr12
  508. \font\shortcontbf=cmbx12
  509. \font\shortcontsl=cmsl12
  510. %% Add scribe-like font environments, plus @l for inline lisp (usually sans
  511. %% serif) and @ii for TeX italic
  512. % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
  513. % unless the following character is such as not to need one.
  514. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
  515. \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
  516. \let\i=\smartitalic
  517. \let\var=\smartitalic
  518. \let\dfn=\smartitalic
  519. \let\emph=\smartitalic
  520. \let\cite=\smartitalic
  521. \def\b#1{{\bf #1}}
  522. \let\strong=\b
  523. \def\t#1{{\tt \exhyphenpenalty=10000\rawbackslash \frenchspacing #1}\null}
  524. \let\ttfont = \t
  525. %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
  526. \def\samp #1{`\tclose{#1}'\null}
  527. \def\key #1{{\tt \exhyphenpenalty=10000\uppercase{#1}}\null}
  528. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  529. \let\file=\samp
  530. % @code is a modification of @t,
  531. % which makes spaces the same size as normal in the surrounding text.
  532. \newdimen\tclosesave
  533. \newdimen\tcloserm
  534. \def\tclose#1{{\rm \tcloserm=\fontdimen2\font \tt \tclosesave=\fontdimen2\font
  535. \fontdimen2\font=\tcloserm
  536. % prevent breaking lines at hyphens.
  537. \exhyphenpenalty=10000
  538. \def\ {{\fontdimen2\font=\tclosesave{} }}%
  539.  \rawbackslash \frenchspacing #1\fontdimen2\font=\tclosesave}\null}
  540. \let\code=\tclose
  541. %\let\exp=\tclose  %Was temporary
  542. % @kbd is like @code, except that if the argument is just one @key command, 
  543. % then @kbd has no effect.
  544. \def\xkey{\key}
  545. \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
  546. \ifx\one\xkey\ifx\threex\three \key{#2}%
  547. \else\tclose{\look}\fi
  548. \else\tclose{\look}\fi}
  549. % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
  550. % argument is to make the input look right: @dmn{pt} instead of
  551. % @dmn{}pt.
  552. \def\dmn#1{\thinspace #1}
  553. \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
  554. \def\l#1{{\li #1}\null}        % 
  555. \def\r#1{{\rm #1}}        % roman font
  556. % Use of \lowercase was suggested.
  557. \def\sc#1{{\smallcaps#1}}    % smallcaps font
  558. \def\ii#1{{\it #1}}        % italic font
  559. \message{page headings,}
  560. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  561. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  562. % First the title page.  Must do @settitle before @titlepage.
  563. \def\titlefont#1{{\titlerm #1}}
  564. \newtoks\realeverypar
  565. \newif\ifseenauthor
  566. \newif\iffinishedtitlepage
  567. \def\titlepage{\begingroup \parindent=0pt \textfonts
  568.    \let\subtitlerm=\tenrm
  569. % I deinstalled the following change because \cmr12 is undefined.
  570. % This change was not in the ChangeLog anyway.  --rms.
  571. %   \let\subtitlerm=\cmr12
  572.    \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
  573.    \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
  574.    % Leave some space at the very top of the page.
  575.    \vglue\titlepagetopglue
  576.    % Now you can print the title using @title.
  577.    \def\title{\parsearg\titlezzz}%
  578.    \def\titlezzz##1{\leftline{\titlefont{##1}}
  579.             % print a rule at the page bottom also.
  580.             \finishedtitlepagefalse
  581.             \vskip4pt \hrule height 4pt \vskip4pt}%
  582.    % No rule at page bottom unless we print one at the top with @title.
  583.    \finishedtitlepagetrue
  584.    % Now you can put text using @subtitle.
  585.    \def\subtitle{\parsearg\subtitlezzz}%
  586.    \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
  587.    % @author should come last, but may come many times.
  588.    \def\author{\parsearg\authorzzz}%
  589.    \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
  590.       {\authorfont \leftline{##1}}}%
  591.    %  
  592.    % Most title ``pages'' are actually two pages long, with space
  593.    % at the top of the second.  We don't want the ragged left on the second.
  594.    \let\oldpage = \page
  595.    \def\page{%
  596.       \iffinishedtitlepage\else
  597.      \finishtitlepage
  598.       \fi
  599.       \oldpage
  600.       \let\page = \oldpage
  601.       \hbox{}}%
  602. %   \def\page{\oldpage \hbox{}}
  603. \def\Etitlepage{%
  604.    \iffinishedtitlepage\else
  605.       \finishtitlepage
  606.    \fi
  607.    % It is important to do the page break before ending the group,
  608.    % because the headline and footline are only empty inside the group.
  609.    % If we use the new definition of \page, we always get a blank page
  610.    % after the title page, which we certainly don't want.
  611.    \oldpage
  612.    \endgroup
  613.    \HEADINGSon
  614. \def\finishtitlepage{%
  615.    \vskip4pt \hrule height 2pt
  616.    \vskip\titlepagebottomglue
  617.    \finishedtitlepagetrue
  618. %%% Set up page headings and footings.
  619. \let\thispage=\folio
  620. \newtoks \evenheadline    % Token sequence for heading line of even pages
  621. \newtoks \oddheadline     % Token sequence for heading line of odd pages
  622. \newtoks \evenfootline    % Token sequence for footing line of even pages
  623. \newtoks \oddfootline     % Token sequence for footing line of odd pages
  624. % Now make Tex use those variables
  625. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  626.                             \else \the\evenheadline \fi}}
  627. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  628.                             \else \the\evenfootline \fi}\HEADINGShook}
  629. \let\HEADINGShook=\relax
  630. % Commands to set those variables.
  631. % For example, this is what  @headings on  does
  632. % @evenheading @thistitle|@thispage|@thischapter
  633. % @oddheading @thischapter|@thispage|@thistitle
  634. % @evenfooting @thisfile||
  635. % @oddfooting ||@thisfile
  636. \def\evenheading{\parsearg\evenheadingxxx}
  637. \def\oddheading{\parsearg\oddheadingxxx}
  638. \def\everyheading{\parsearg\everyheadingxxx}
  639. \def\evenfooting{\parsearg\evenfootingxxx}
  640. \def\oddfooting{\parsearg\oddfootingxxx}
  641. \def\everyfooting{\parsearg\everyfootingxxx}
  642. {\catcode`\@=0 %
  643. \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
  644. \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
  645. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  646. \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
  647. \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
  648. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  649. \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
  650. \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
  651. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  652. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  653. \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
  654. \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
  655. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  656. \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
  657. \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
  658. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  659. \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
  660. \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
  661. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  662. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  663. }% unbind the catcode of @.
  664. % @headings double    turns headings on for double-sided printing.
  665. % @headings single    turns headings on for single-sided printing.
  666. % @headings off        turns them off.
  667. % @headings on        same as @headings double, retained for compatibility.
  668. % @headings after    turns on double-sided headings after this page.
  669. % @headings doubleafter    turns on double-sided headings after this page.
  670. % @headings singleafter turns on single-sided headings after this page.
  671. % By default, they are off.
  672. \def\headings #1 {\csname HEADINGS#1\endcsname}
  673. \def\HEADINGSoff{
  674. \global\evenheadline={\hfil} \global\evenfootline={\hfil}
  675. \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
  676. \HEADINGSoff
  677. % When we turn headings on, set the page number to 1.
  678. % For double-sided printing, put current file name in lower left corner,
  679. % chapter name on inside top of right hand pages, document
  680. % title on inside top of left hand pages, and page numbers on outside top
  681. % edge of all pages.
  682. \def\HEADINGSdouble{
  683. %\pagealignmacro
  684. \global\pageno=1
  685. \global\evenfootline={\hfil}
  686. \global\oddfootline={\hfil}
  687. \global\evenheadline={\line{\folio\hfil\thistitle}}
  688. \global\oddheadline={\line{\thischapter\hfil\folio}}
  689. % For single-sided printing, chapter title goes across top left of page,
  690. % page number on top right.
  691. \def\HEADINGSsingle{
  692. %\pagealignmacro
  693. \global\pageno=1
  694. \global\evenfootline={\hfil}
  695. \global\oddfootline={\hfil}
  696. \global\evenheadline={\line{\thischapter\hfil\folio}}
  697. \global\oddheadline={\line{\thischapter\hfil\folio}}
  698. \def\HEADINGSon{\HEADINGSdouble}
  699. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  700. \let\HEADINGSdoubleafter=\HEADINGSafter
  701. \def\HEADINGSdoublex{%
  702. \global\evenfootline={\hfil}
  703. \global\oddfootline={\hfil}
  704. \global\evenheadline={\line{\folio\hfil\thistitle}}
  705. \global\oddheadline={\line{\thischapter\hfil\folio}}
  706. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  707. \def\HEADINGSsinglex{%
  708. \global\evenfootline={\hfil}
  709. \global\oddfootline={\hfil}
  710. \global\evenheadline={\line{\thischapter\hfil\folio}}
  711. \global\oddheadline={\line{\thischapter\hfil\folio}}
  712. % Subroutines used in generating headings
  713. % Produces Day Month Year style of output.
  714. \def\today{\number\day\space
  715. \ifcase\month\or
  716. January\or February\or March\or April\or May\or June\or
  717. July\or August\or September\or October\or November\or December\fi
  718. \space\number\year}
  719. % Use this if you want the Month Day, Year style of output.
  720. %\def\today{\ifcase\month\or
  721. %January\or February\or March\or April\or May\or June\or
  722. %July\or August\or September\or October\or November\or December\fi
  723. %\space\number\day, \number\year}
  724. % @settitle line...  specifies the title of the document, for headings
  725. % It generates no output of its own
  726. \def\thistitle{No Title}
  727. \def\settitle{\parsearg\settitlezzz}
  728. \def\settitlezzz #1{\gdef\thistitle{#1}}
  729. \message{tables,}
  730. % @tabs -- simple alignment
  731. % These don't work.  For one thing, \+ is defined as outer.
  732. % So these macros cannot even be defined.
  733. %\def\tabs{\parsearg\tabszzz}
  734. %\def\tabszzz #1{\settabs\+#1\cr}
  735. %\def\tabline{\parsearg\tablinezzz}
  736. %\def\tablinezzz #1{\+#1\cr}
  737. %\def\&{&}
  738. % Tables -- @table, @ftable, @item(x), @kitem(x), @xitem(x).
  739. % default indentation of table text
  740. \newdimen\tableindent \tableindent=.8in
  741. % default indentation of @itemize and @enumerate text
  742. \newdimen\itemindent  \itemindent=.3in
  743. % margin between end of table item and start of table text.
  744. \newdimen\itemmargin  \itemmargin=.1in
  745. % used internally for \itemindent minus \itemmargin
  746. \newdimen\itemmax
  747. % Note @table and @ftable define @item, @itemx, etc., with these defs.
  748. % They also define \itemindex
  749. % to index the item name in whatever manner is desired (perhaps none).
  750. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  751. \def\internalBitemx{\par \parsearg\itemzzz}
  752. \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
  753. \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
  754. \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
  755. \def\internalBkitemx{\par \parsearg\kitemzzz}
  756. \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
  757.                  \itemzzz {#1}}
  758. \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
  759.                  \itemzzz {#1}}
  760. \def\itemzzz #1{\begingroup %
  761.   \advance\hsize by -\rightskip
  762.   \advance\hsize by -\tableindent
  763.   \setbox0=\hbox{\itemfont{#1}}%
  764.   \itemindex{#1}%
  765.   \nobreak % This prevents a break before @itemx.
  766.   % Be sure we are not still in the middle of a paragraph.
  767.   \parskip=0in
  768.   \par
  769.   % If the item text does not fit in the space we have, put it on a line
  770.   % by itself, and do not allow a page break either before or after that
  771.   % line.  We do not start a paragraph here because then if the next
  772.   % command is, e.g., @kindex, the whatsit would get put into the
  773.   % horizontal list on a line by itself, resulting in extra blank space.
  774.   \ifdim \wd0>\itemmax
  775.     \setbox0=\hbox{\hskip \leftskip \hskip -\tableindent \unhbox0}\box0
  776.     \nobreak
  777.   \else
  778.     % The item text fits into the space.  Start a paragraph, so that the
  779.     % following text (if any) will end up on the same line.  Since that
  780.     % text will be indented by \tableindent, we make the item text be in
  781.     % a zero-width box.
  782.     \noindent
  783.     \rlap{\hskip -\tableindent\box0}%
  784.   \fi
  785.   \endgroup
  786. \def\item{\errmessage{@item while not in a table}}
  787. \def\itemx{\errmessage{@itemx while not in a table}}
  788. \def\kitem{\errmessage{@kitem while not in a table}}
  789. \def\kitemx{\errmessage{@kitemx while not in a table}}
  790. \def\xitem{\errmessage{@xitem while not in a table}}
  791. \def\xitemx{\errmessage{@xitemx while not in a table}}
  792. %% Contains a kludge to get @end[description] to work
  793. \def\description{\tablez{\dontindex}{1}{}{}{}{}}
  794. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
  795. {\obeylines\obeyspaces%
  796. \gdef\tablex #1^^M{%
  797. \tabley\dontindex#1        \endtabley}}
  798. \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
  799. {\obeylines\obeyspaces%
  800. \gdef\ftablex #1^^M{%
  801. \tabley\fnitemindex#1        \endtabley
  802. \def\Eftable{\endgraf\endgroup\afterenvbreak}%
  803. \let\Etable=\relax}}
  804. \def\dontindex #1{}
  805. \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
  806. {\obeyspaces %
  807. \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
  808. \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
  809. \def\tablez #1#2#3#4#5#6{%
  810. \aboveenvbreak %
  811. \begingroup %
  812. \def\Edescription{\Etable}% Neccessary kludge.
  813. \let\itemindex=#1%
  814. \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
  815. \ifnum 0#4>0 \tableindent=#4\mil \fi %
  816. \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
  817. \def\itemfont{#2}%
  818. \itemmax=\tableindent %
  819. \advance \itemmax by -\itemmargin %
  820. \advance \leftskip by \tableindent %
  821. \exdentamount=\tableindent
  822. \parindent = 0pt
  823. \parskip = \smallskipamount
  824. \ifdim \parskip=0pt \parskip=2pt \fi%
  825. \def\Etable{\endgraf\endgroup\afterenvbreak}%
  826. \let\item = \internalBitem %
  827. \let\itemx = \internalBitemx %
  828. \let\kitem = \internalBkitem %
  829. \let\kitemx = \internalBkitemx %
  830. \let\xitem = \internalBxitem %
  831. \let\xitemx = \internalBxitemx %
  832. % This is the counter used by @enumerate, which is really @itemize
  833. \newcount \itemno
  834. \def\itemize{\parsearg\itemizezzz}
  835. \def\itemizezzz #1{%
  836.   \begingroup % ended by the @end itemsize
  837.   \itemizey {#1}{\Eitemize}
  838. \def\itemizey #1#2{%
  839. \aboveenvbreak %
  840. \itemmax=\itemindent %
  841. \advance \itemmax by -\itemmargin %
  842. \advance \leftskip by \itemindent %
  843. \exdentamount=\itemindent
  844. \parindent = 0pt %
  845. \parskip = \smallskipamount %
  846. \ifdim \parskip=0pt \parskip=2pt \fi%
  847. \def#2{\endgraf\endgroup\afterenvbreak}%
  848. \def\itemcontents{#1}%
  849. \let\item=\itemizeitem}
  850. \def\bullet{$\ptexbullet$}
  851. \def\minus{$-$}
  852. % Set sfcode to normal for the chars that usually have another value.
  853. % These are `.?!:;,'
  854. \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
  855.   \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
  856. % \splitoff TOKENS\endmark defines \first to be the first token in
  857. % TOKENS, and \rest to be the remainder.
  858. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  859. % Allow an optional argument of an uppercase letter, lowercase letter,
  860. % or number, to specify the first label in the enumerated list.  No
  861. % argument is the same as `1'.
  862. \def\enumerate{\parsearg\enumeratezzz}
  863. \def\enumeratezzz #1{\enumeratey #1  \endenumeratey}
  864. \def\enumeratey #1 #2\endenumeratey{%
  865.   \begingroup % ended by the @end enumerate
  866.   % If we were given no argument, pretend we were given `1'.
  867.   \def\thearg{#1}%
  868.   \ifx\thearg\empty \def\thearg{1}\fi
  869.   % Detect if the argument is a single token.  If so, it might be a
  870.   % letter.  Otherwise, the only valid thing it can be is a number.
  871.   % (We will always have one token, because of the test we just made.
  872.   % This is a good thing, since \splitoff doesn't work given nothing at
  873.   % all -- the first parameter is undelimited.)
  874.   \expandafter\splitoff\thearg\endmark
  875.   \ifx\rest\empty
  876.     % Only one token in the argument.  It could still be anything.
  877.     % A ``lowercase letter'' is one whose \lccode is nonzero.
  878.     % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  879.     %   not equal to itself.
  880.     % Otherwise, we assume it's a number.
  881.     % 
  882.     % We need the \relax at the end of the \ifnum lines to stop TeX from
  883.     % continuing to look for a <number>.
  884.     % 
  885.     \ifnum\lccode\expandafter`\thearg=0\relax 
  886.       \numericenumerate % a number (we hope)
  887.     \else
  888.       % It's a letter.
  889.       \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  890.         \lowercaseenumerate % lowercase letter
  891.       \else
  892.         \uppercaseenumerate % uppercase letter
  893.       \fi
  894.     \fi
  895.   \else
  896.     % Multiple tokens in the argument.  We hope it's a number.
  897.     \numericenumerate
  898.   \fi
  899. % An @enumerate whose labels are integers.  The starting integer is
  900. % given in \thearg.
  901. \def\numericenumerate{%
  902.   \itemno = \thearg
  903.   \startenumeration{\the\itemno}%
  904. % The starting (lowercase) letter is in \thearg.
  905. \def\lowercaseenumerate{%
  906.   \itemno = \expandafter`\thearg
  907.   \startenumeration{%
  908.     % Be sure we're not beyond the end of the alphabet.
  909.     \ifnum\itemno=0
  910.       \errmessage{No more lowercase letters in @enumerate; get a bigger
  911.                   alphabet}%
  912.     \fi
  913.     \char\lccode\itemno
  914. % The starting (uppercase) letter is in \thearg.
  915. \def\uppercaseenumerate{%
  916.   \itemno = \expandafter`\thearg
  917.   \startenumeration{%
  918.     % Be sure we're not beyond the end of the alphabet.
  919.     \ifnum\itemno=0
  920.       \errmessage{No more uppercase letters in @enumerate; get a bigger
  921.                   alphabet}
  922.     \fi
  923.     \char\uccode\itemno
  924. % Call itemizey, adding a period to the first argument and supplying the
  925. % common last two arguments.  Also subtract one from the initial value in
  926. % \itemno, since @item increments \itemno.
  927. \def\startenumeration#1{%
  928.   \advance\itemno by -1
  929.   \itemizey{#1.}\Eenumerate\flushcr
  930. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  931. % to @enumerate.
  932. \def\alphaenumerate{\enumerate{a}}
  933. \def\capsenumerate{\enumerate{A}}
  934. \def\Ealphaenumerate{\Eenumerate}
  935. \def\Ecapsenumerate{\Eenumerate}
  936. % Definition of @item while inside @itemize.
  937. \def\itemizeitem{%
  938. \advance\itemno by 1
  939. {\let\par=\endgraf \smallbreak}%
  940. \ifhmode \errmessage{\in hmode at itemizeitem}\fi
  941. {\parskip=0in \hskip 0pt
  942. \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
  943. \vadjust{\penalty 1200}}%
  944. \flushcr}
  945. \message{indexing,}
  946. % Index generation facilities
  947. % Define \newwrite to be identical to plain tex's \newwrite
  948. % except not \outer, so it can be used within \newindex.
  949. {\catcode`\@=11
  950. \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
  951. % \newindex {foo} defines an index named foo.
  952. % It automatically defines \fooindex such that
  953. % \fooindex ...rest of line... puts an entry in the index foo.
  954. % It also defines \fooindfile to be the number of the output channel for
  955. % the file that    accumulates this index.  The file's extension is foo.
  956. % The name of an index should be no more than 2 characters long
  957. % for the sake of vms.
  958. \def\newindex #1{
  959. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  960. \openout \csname#1indfile\endcsname \jobname.#1    % Open the file
  961. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  962. \noexpand\doindex {#1}}
  963. % @defindex foo  ==  \newindex{foo}
  964. \def\defindex{\parsearg\newindex}
  965. % Define @defcodeindex, like @defindex except put all entries in @code.
  966. \def\newcodeindex #1{
  967. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  968. \openout \csname#1indfile\endcsname \jobname.#1    % Open the file
  969. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  970. \noexpand\docodeindex {#1}}
  971. \def\defcodeindex{\parsearg\newcodeindex}
  972. % @synindex foo bar    makes index foo feed into index bar.
  973. % Do this instead of @defindex foo if you don't want it as a separate index.
  974. \def\synindex #1 #2 {%
  975. \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
  976. \expandafter\let\csname#1indfile\endcsname=\synindexfoo
  977. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  978. \noexpand\doindex {#2}}%
  979. % @syncodeindex foo bar   similar, but put all entries made for index foo
  980. % inside @code.
  981. \def\syncodeindex #1 #2 {%
  982. \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
  983. \expandafter\let\csname#1indfile\endcsname=\synindexfoo
  984. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  985. \noexpand\docodeindex {#2}}%
  986. % Define \doindex, the driver for all \fooindex macros.
  987. % Argument #1 is generated by the calling \fooindex macro,
  988. %  and it is "foo", the name of the index.
  989. % \doindex just uses \parsearg; it calls \doind for the actual work.
  990. % This is because \doind is more useful to call from other macros.
  991. % There is also \dosubind {index}{topic}{subtopic}
  992. % which makes an entry in a two-level index such as the operation index.
  993. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  994. \def\singleindexer #1{\doind{\indexname}{#1}}
  995. % like the previous two, but they put @code around the argument.
  996. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  997. \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  998. \def\indexdummies{%
  999. \def\_{{\realbackslash _}}%
  1000. \def\w{\realbackslash w }%
  1001. \def\bf{\realbackslash bf }%
  1002. \def\rm{\realbackslash rm }%
  1003. \def\sl{\realbackslash sl }%
  1004. \def\sf{\realbackslash sf}%
  1005. \def\tt{\realbackslash tt}%
  1006. \def\gtr{\realbackslash gtr}%
  1007. \def\less{\realbackslash less}%
  1008. \def\hat{\realbackslash hat}%
  1009. \def\char{\realbackslash char}%
  1010. \def\TeX{\realbackslash TeX}%
  1011. \def\dots{\realbackslash dots }%
  1012. \def\copyright{\realbackslash copyright }%
  1013. \def\tclose##1{\realbackslash tclose {##1}}%
  1014. \def\code##1{\realbackslash code {##1}}%
  1015. \def\samp##1{\realbackslash samp {##1}}%
  1016. \def\t##1{\realbackslash r {##1}}%
  1017. \def\r##1{\realbackslash r {##1}}%
  1018. \def\i##1{\realbackslash i {##1}}%
  1019. \def\b##1{\realbackslash b {##1}}%
  1020. \def\cite##1{\realbackslash cite {##1}}%
  1021. \def\key##1{\realbackslash key {##1}}%
  1022. \def\file##1{\realbackslash file {##1}}%
  1023. \def\var##1{\realbackslash var {##1}}%
  1024. \def\kbd##1{\realbackslash kbd {##1}}%
  1025. % \indexnofonts no-ops all font-change commands.
  1026. % This is used when outputting the strings to sort the index by.
  1027. \def\indexdummyfont#1{#1}
  1028. \def\indexdummytex{TeX}
  1029. \def\indexdummydots{...}
  1030. \def\indexnofonts{%
  1031. \let\w=\indexdummyfont
  1032. \let\t=\indexdummyfont
  1033. \let\r=\indexdummyfont
  1034. \let\i=\indexdummyfont
  1035. \let\b=\indexdummyfont
  1036. \let\emph=\indexdummyfont
  1037. \let\strong=\indexdummyfont
  1038. \let\cite=\indexdummyfont
  1039. \let\sc=\indexdummyfont
  1040. %Don't no-op \tt, since it isn't a user-level command
  1041. % and is used in the definitions of the active chars like <, >, |...
  1042. %\let\tt=\indexdummyfont
  1043. \let\tclose=\indexdummyfont
  1044. \let\code=\indexdummyfont
  1045. \let\file=\indexdummyfont
  1046. \let\samp=\indexdummyfont
  1047. \let\kbd=\indexdummyfont
  1048. \let\key=\indexdummyfont
  1049. \let\var=\indexdummyfont
  1050. \let\TeX=\indexdummytex
  1051. \let\dots=\indexdummydots
  1052. % To define \realbackslash, we must make \ not be an escape.
  1053. % We must first make another character (@) an escape
  1054. % so we do not become unable to do a definition.
  1055. {\catcode`\@=0 \catcode`\\=\other
  1056. @gdef@realbackslash{\}}
  1057. \let\indexbackslash=0  %overridden during \printindex.
  1058. \def\doind #1#2{%
  1059. {\count10=\lastpenalty %
  1060. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  1061. \escapechar=`\\%
  1062. {\let\folio=0% Expand all macros now EXCEPT \folio
  1063. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
  1064. % so it will be output as is; and it will print as backslash in the indx.
  1065. % Now process the index-string once, with all font commands turned off,
  1066. % to get the string to sort the index by.
  1067. {\indexnofonts
  1068. \xdef\temp1{#2}%
  1069. % Now produce the complete index entry.  We process the index-string again,
  1070. % this time with font commands expanded, to get what to print in the index.
  1071. \edef\temp{%
  1072. \write \csname#1indfile\endcsname{%
  1073. \realbackslash entry {\temp1}{\folio}{#2}}}%
  1074. \temp }%
  1075. }\penalty\count10}}
  1076. \def\dosubind #1#2#3{%
  1077. {\count10=\lastpenalty %
  1078. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  1079. \escapechar=`\\%
  1080. {\let\folio=0%
  1081. \def\rawbackslashxx{\indexbackslash}%
  1082. % Now process the index-string once, with all font commands turned off,
  1083. % to get the string to sort the index by.
  1084. {\indexnofonts
  1085. \xdef\temp1{#2 #3}%
  1086. % Now produce the complete index entry.  We process the index-string again,
  1087. % this time with font commands expanded, to get what to print in the index.
  1088. \edef\temp{%
  1089. \write \csname#1indfile\endcsname{%
  1090. \realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
  1091. \temp }%
  1092. }\penalty\count10}}
  1093. % The index entry written in the file actually looks like
  1094. %  \entry {sortstring}{page}{topic}
  1095. %  \entry {sortstring}{page}{topic}{subtopic}
  1096. % The texindex program reads in these files and writes files
  1097. % containing these kinds of lines:
  1098. %  \initial {c}
  1099. %     before the first topic whose initial is c
  1100. %  \entry {topic}{pagelist}
  1101. %     for a topic that is used without subtopics
  1102. %  \primary {topic}
  1103. %     for the beginning of a topic that is used with subtopics
  1104. %  \secondary {subtopic}{pagelist}
  1105. %     for each subtopic.
  1106. % Define the user-accessible indexing commands 
  1107. % @findex, @vindex, @kindex, @cindex.
  1108. \def\findex {\fnindex}
  1109. \def\kindex {\kyindex}
  1110. \def\cindex {\cpindex}
  1111. \def\vindex {\vrindex}
  1112. \def\tindex {\tpindex}
  1113. \def\pindex {\pgindex}
  1114. \def\cindexsub {\begingroup\obeylines\cindexsub}
  1115. {\obeylines %
  1116. \gdef\cindexsub "#1" #2^^M{\endgroup %
  1117. \dosubind{cp}{#2}{#1}}}
  1118. % Define the macros used in formatting output of the sorted index material.
  1119. % This is what you call to cause a particular index to get printed.
  1120. % Write
  1121. % @unnumbered Function Index
  1122. % @printindex fn
  1123. \def\printindex{\parsearg\doprintindex}
  1124. \def\doprintindex#1{%
  1125.   \tex
  1126.   \dobreak \chapheadingskip {10000}
  1127.   \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
  1128.   \catcode`\$=\other\catcode`\_=\other
  1129.   \catcode`\~=\other
  1130.   % The following don't help, since the chars were translated
  1131.   % when the raw index was written, and their fonts were discarded
  1132.   % due to \indexnofonts.
  1133.   %\catcode`\"=\active
  1134.   %\catcode`\^=\active
  1135.   %\catcode`\_=\active
  1136.   %\catcode`\|=\active
  1137.   %\catcode`\<=\active
  1138.   %\catcode`\>=\active
  1139.   % %
  1140.   \def\indexbackslash{\rawbackslashxx}
  1141.   \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
  1142.   \begindoublecolumns
  1143.   % See if the index file exists and is nonempty.
  1144.   \openin 1 \jobname.#1s
  1145.   \ifeof 1 
  1146.     % \enddoublecolumns gets confused if there is no text in the index,
  1147.     % and it loses the chapter title and the aux file entries for the
  1148.     % index.  The easiest way to prevent this problem is to make sure
  1149.     % there is some text.
  1150.     (Index is nonexistent)
  1151.     \else
  1152.     %
  1153.     % If the index file exists but is empty, then \openin leaves \ifeof
  1154.     % false.  We have to make TeX try to read something from the file, so
  1155.     % it can discover if there is anything in it.
  1156.     \read 1 to \temp
  1157.     \ifeof 1
  1158.       (Index is empty)
  1159.     \else
  1160.       \input \jobname.#1s
  1161.     \fi
  1162.   \fi
  1163.   \closein 1
  1164.   \enddoublecolumns
  1165.   \Etex
  1166. % These macros are used by the sorted index file itself.
  1167. % Change them to control the appearance of the index.
  1168. % Same as \bigskipamount except no shrink.
  1169. % \balancecolumns gets confused if there is any shrink.
  1170. \newskip\initialskipamount \initialskipamount 12pt plus4pt
  1171. \def\initial #1{%
  1172. {\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  1173. \ifdim\lastskip<\initialskipamount
  1174. \removelastskip \penalty-200 \vskip \initialskipamount\fi
  1175. \line{\secbf#1\hfill}\kern 2pt\penalty10000}}
  1176. \def\entry #1#2{\begingroup
  1177.   \parfillskip=0in \parskip=0in \parindent=0in
  1178.   % \hangindent is only relevant when the page number and the entry text
  1179.   % don't fit on one line.  In that case, bob suggests starting the dots
  1180.   % pretty far over on the line.
  1181.   % \hangafter is reset to 1 at the start of each paragraph.
  1182.   \hangindent=.75\hsize
  1183.   \noindent
  1184.   % Don't break the text of the index entry.
  1185.   \hbox{#1}%
  1186.   % If we must, put the page number on a line of its own, and fill out
  1187.   % this line with blank space.  (The \hfil is overwhelmed with the
  1188.   % fill leaders glue in \indexdotfill if the page number does fit.)
  1189.   \hfil\penalty50
  1190.   \null\nobreak\indexdotfill % Have leaders before the page number.
  1191.   % The `\ ' here is removed by the implicit \unskip that TeX does as
  1192.   % part of (the primitive) \par.  Without, a spurious underfull \hbox ensues.
  1193.   \ #2% The page number ends the paragraph.
  1194.   \par
  1195. \endgroup}
  1196. % Like \dotfill except takes at least 1 em.
  1197. \def\indexdotfill{\cleaders
  1198.   \hbox{$\mathsurround=0pt \mkern1.5mu . \mkern1.5mu$}\hskip 1em plus 1fill}
  1199. \def\primary #1{\line{#1\hfil}}
  1200. \newskip\secondaryindent \secondaryindent=0.5cm
  1201. \def\secondary #1#2{
  1202. {\parfillskip=0in \parskip=0in
  1203. \hangindent =1in \hangafter=1
  1204. \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
  1205. %% Define two-column mode, which is used in indexes.
  1206. %% Adapted from the TeXBook, page 416
  1207. \catcode `\@=11
  1208. \newbox\partialpage
  1209. \newdimen\doublecolumnhsize  \doublecolumnhsize = 3.11in
  1210. \newdimen\doublecolumnvsize  \doublecolumnvsize = 19.1in
  1211. \newdimen\availdimen@
  1212. \def\begindoublecolumns{\begingroup
  1213.   \output={\global\setbox\partialpage=
  1214.     \vbox{\unvbox255\kern -\topskip \kern \baselineskip}}\eject
  1215.   \output={\doublecolumnout}%
  1216.   \hsize=\doublecolumnhsize \vsize=\doublecolumnvsize}
  1217. \def\enddoublecolumns{\output={\balancecolumns}\eject
  1218.   \endgroup \pagegoal=\vsize}
  1219. \def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
  1220.   \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
  1221.   \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  1222.   \onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
  1223. \def\pagesofar{\unvbox\partialpage %
  1224.   \hsize=\doublecolumnhsize % have to restore this since output routine
  1225. %          changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986)
  1226.   \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
  1227. \def\balancecolumns{%
  1228. % Unset the glue.
  1229.   \setbox255=\vbox{\unvbox255}
  1230.   \dimen@=\ht255
  1231.   \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  1232.   \divide\dimen@ by2
  1233.   \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpage
  1234. % If the remaining data is too big for one page,
  1235. % output one page normally, then work with what remains.
  1236.   \ifdim \dimen@>\availdimen@
  1237.      \splittopskip=\topskip \splitmaxdepth=\maxdepth
  1238.      \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
  1239.      \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  1240.      \onepageout\pagesofar
  1241. % Recompute size of what remains, in case we just output some of it.
  1242.   \dimen@=\ht255
  1243.   \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  1244.   \divide\dimen@ by2
  1245.   \fi
  1246.   \setbox0=\vbox{\unvbox255}
  1247.   \splittopskip=\topskip
  1248.   {\vbadness=10000 \loop \global\setbox3=\copy0
  1249.     \global\setbox1=\vsplit3 to\dimen@
  1250.     \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
  1251.   \setbox0=\vbox to\dimen@{\unvbox1}  \setbox2=\vbox to\dimen@{\unvbox3}
  1252.   \pagesofar}
  1253. \catcode `\@=\other
  1254. \message{sectioning,}
  1255. % Define chapters, sections, etc.
  1256. \newcount \chapno
  1257. \newcount \secno        \secno=0
  1258. \newcount \subsecno     \subsecno=0
  1259. \newcount \subsubsecno  \subsubsecno=0
  1260. % This counter is funny since it counts through charcodes of letters A, B, ...
  1261. \newcount \appendixno  \appendixno = `\@
  1262. \def\appendixletter{\char\the\appendixno}
  1263. \newwrite \contentsfile
  1264. % This is called from \setfilename.
  1265. \def\opencontents{\openout \contentsfile = \jobname.toc}
  1266. % Each @chapter defines this as the name of the chapter.
  1267. % page headings and footings can use it.  @section does likewise
  1268. \def\thischapter{} \def\thissection{}
  1269. \def\seccheck#1{\if \pageno<0 %
  1270. \errmessage{@#1 not allowed after generating table of contents}\fi
  1271. \def\chapternofonts{%
  1272. \let\rawbackslash=\relax%
  1273. \let\frenchspacing=\relax%
  1274. \def\result{\realbackslash result}
  1275. \def\equiv{\realbackslash equiv}
  1276. \def\expansion{\realbackslash expansion}
  1277. \def\print{\realbackslash print}
  1278. \def\TeX{\realbackslash TeX}
  1279. \def\dots{\realbackslash dots}
  1280. \def\copyright{\realbackslash copyright}
  1281. \def\tt{\realbackslash tt}
  1282. \def\bf{\realbackslash bf }
  1283. \def\w{\realbackslash w}
  1284. \def\less{\realbackslash less}
  1285. \def\gtr{\realbackslash gtr}
  1286. \def\hat{\realbackslash hat}
  1287. \def\char{\realbackslash char}
  1288. \def\tclose##1{\realbackslash tclose {##1}}
  1289. \def\code##1{\realbackslash code {##1}}
  1290. \def\samp##1{\realbackslash samp {##1}}
  1291. \def\r##1{\realbackslash r {##1}}
  1292. \def\b##1{\realbackslash b {##1}}
  1293. \def\key##1{\realbackslash key {##1}}
  1294. \def\file##1{\realbackslash file {##1}}
  1295. \def\kbd##1{\realbackslash kbd {##1}}
  1296. % These are redefined because @smartitalic wouldn't work inside xdef.
  1297. \def\i##1{\realbackslash i {##1}}
  1298. \def\cite##1{\realbackslash cite {##1}}
  1299. \def\var##1{\realbackslash var {##1}}
  1300. \def\emph##1{\realbackslash emph {##1}}
  1301. \def\dfn##1{\realbackslash dfn {##1}}
  1302. \def\thischaptername{No Chapter Title}
  1303. \outer\def\chapter{\parsearg\chapterzzz}
  1304. \def\chapterzzz #1{\seccheck{chapter}%
  1305. \secno=0 \subsecno=0 \subsubsecno=0
  1306. \global\advance \chapno by 1 \message{Chapter \the\chapno}%
  1307. \chapmacro {#1}{\the\chapno}%
  1308. \gdef\thissection{#1}%
  1309. \gdef\thischaptername{#1}%
  1310. % We don't substitute the actual chapter name into \thischapter
  1311. % because we don't want its macros evaluated now.
  1312. \xdef\thischapter{Chapter \the\chapno: \noexpand\thischaptername}%
  1313. {\chapternofonts%
  1314. \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
  1315. \escapechar=`\\%
  1316. \write \contentsfile \temp  %
  1317. \donoderef %
  1318. \global\let\section = \numberedsec
  1319. \global\let\subsection = \numberedsubsec
  1320. \global\let\subsubsection = \numberedsubsubsec
  1321. \outer\def\appendix{\parsearg\appendixzzz}
  1322. \def\appendixzzz #1{\seccheck{appendix}%
  1323. \secno=0 \subsecno=0 \subsubsecno=0
  1324. \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
  1325. \chapmacro {#1}{Appendix \appendixletter}%
  1326. \gdef\thissection{#1}%
  1327. \gdef\thischaptername{#1}%
  1328. \xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}%
  1329. {\chapternofonts%
  1330. \edef\temp{{\realbackslash chapentry 
  1331.   {#1}{Appendix \appendixletter}{\noexpand\folio}}}%
  1332. \escapechar=`\\%
  1333. \write \contentsfile \temp  %
  1334. \appendixnoderef %
  1335. \global\let\section = \appendixsec
  1336. \global\let\subsection = \appendixsubsec
  1337. \global\let\subsubsection = \appendixsubsubsec
  1338. \outer\def\top{\parsearg\unnumberedzzz}
  1339. \outer\def\unnumbered{\parsearg\unnumberedzzz}
  1340. \def\unnumberedzzz #1{\seccheck{unnumbered}%
  1341. \secno=0 \subsecno=0 \subsubsecno=0 \message{(#1)}
  1342. \unnumbchapmacro {#1}%
  1343. \gdef\thischapter{#1}\gdef\thissection{#1}%
  1344. {\chapternofonts%
  1345. \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
  1346. \escapechar=`\\%
  1347. \write \contentsfile \temp  %
  1348. \unnumbnoderef %
  1349. \global\let\section = \unnumberedsec
  1350. \global\let\subsection = \unnumberedsubsec
  1351. \global\let\subsubsection = \unnumberedsubsubsec
  1352. \outer\def\numberedsec{\parsearg\seczzz}
  1353. \def\seczzz #1{\seccheck{section}%
  1354. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  1355. \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
  1356. {\chapternofonts%
  1357. \edef\temp{{\realbackslash secentry %
  1358. {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
  1359. \escapechar=`\\%
  1360. \write \contentsfile \temp %
  1361. \donoderef %
  1362. \penalty 10000 %
  1363. \outer\def\appendixsection{\parsearg\appendixsectionzzz}
  1364. \outer\def\appendixsec{\parsearg\appendixsectionzzz}
  1365. \def\appendixsectionzzz #1{\seccheck{appendixsection}%
  1366. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  1367. \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
  1368. {\chapternofonts%
  1369. \edef\temp{{\realbackslash secentry %
  1370. {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
  1371. \escapechar=`\\%
  1372. \write \contentsfile \temp %
  1373. \appendixnoderef %
  1374. \penalty 10000 %
  1375. \outer\def\unnumberedsec{\parsearg\unnumberedseczzz}
  1376. \def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
  1377. \plainsecheading {#1}\gdef\thissection{#1}%
  1378. {\chapternofonts%
  1379. \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
  1380. \escapechar=`\\%
  1381. \write \contentsfile \temp %
  1382. \unnumbnoderef %
  1383. \penalty 10000 %
  1384. \outer\def\numberedsubsec{\parsearg\numberedsubseczzz}
  1385. \def\numberedsubseczzz #1{\seccheck{subsection}%
  1386. \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
  1387. \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
  1388. {\chapternofonts%
  1389. \edef\temp{{\realbackslash subsecentry %
  1390. {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  1391. \escapechar=`\\%
  1392. \write \contentsfile \temp %
  1393. \donoderef %
  1394. \penalty 10000 %
  1395. \outer\def\appendixsubsec{\parsearg\appendixsubseczzz}
  1396. \def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
  1397. \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
  1398. \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
  1399. {\chapternofonts%
  1400. \edef\temp{{\realbackslash subsecentry %
  1401. {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  1402. \escapechar=`\\%
  1403. \write \contentsfile \temp %
  1404. \appendixnoderef %
  1405. \penalty 10000 %
  1406. \outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz}
  1407. \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
  1408. \plainsecheading {#1}\gdef\thissection{#1}%
  1409. {\chapternofonts%
  1410. \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
  1411. \escapechar=`\\%
  1412. \write \contentsfile \temp %
  1413. \unnumbnoderef %
  1414. \penalty 10000 %
  1415. \outer\def\numberedsubsubsec{\parsearg\numberedsubsubseczzz}
  1416. \def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
  1417. \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
  1418. \subsubsecheading {#1}
  1419.   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
  1420. {\chapternofonts%
  1421. \edef\temp{{\realbackslash subsubsecentry %
  1422.   {#1}
  1423.   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
  1424.   {\noexpand\folio}}}%
  1425. \escapechar=`\\%
  1426. \write \contentsfile \temp %
  1427. \donoderef %
  1428. \penalty 10000 %
  1429. \outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz}
  1430. \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
  1431. \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
  1432. \subsubsecheading {#1}
  1433.   {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
  1434. {\chapternofonts%
  1435. \edef\temp{{\realbackslash subsubsecentry{#1}%
  1436.   {\appendixletter}
  1437.   {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
  1438. \escapechar=`\\%
  1439. \write \contentsfile \temp %
  1440. \appendixnoderef %
  1441. \penalty 10000 %
  1442. \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
  1443. \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
  1444. \plainsecheading {#1}\gdef\thissection{#1}%
  1445. {\chapternofonts%
  1446. \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
  1447. \escapechar=`\\%
  1448. \write \contentsfile \temp %
  1449. \unnumbnoderef %
  1450. \penalty 10000 %
  1451. % These are variants which are not "outer", so they can appear in @ifinfo.
  1452. % Actually, they should now be obsolete; ordinary section commands should work.
  1453. \def\infotop{\parsearg\unnumberedzzz}
  1454. \def\infounnumbered{\parsearg\unnumberedzzz}
  1455. \def\infounnumberedsec{\parsearg\unnumberedseczzz}
  1456. \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
  1457. \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
  1458. \def\infoappendix{\parsearg\appendixzzz}
  1459. \def\infoappendixsec{\parsearg\appendixseczzz}
  1460. \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
  1461. \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
  1462. \def\infochapter{\parsearg\chapterzzz}
  1463. \def\infosection{\parsearg\sectionzzz}
  1464. \def\infosubsection{\parsearg\subsectionzzz}
  1465. \def\infosubsubsection{\parsearg\subsubsectionzzz}
  1466. % These macros control what the section commands do, according
  1467. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  1468. % Define them by default for a numbered chapter.
  1469. \global\let\section = \numberedsec
  1470. \global\let\subsection = \numberedsubsec
  1471. \global\let\subsubsection = \numberedsubsubsec
  1472. % Define @majorheading, @heading and @subheading
  1473. % NOTE on use of \vbox for chapter headings, section headings, and
  1474. % such:
  1475. %    1) We use \vbox rather than the earlier \line to permit
  1476. %       overlong headings to fold.
  1477. %    2) \hyphenpenalty is set to 10000 because hyphenation in a
  1478. %       heading is obnoxious; this forbids it.
  1479. %       3) Likewise, headings look best if no \parindent is used, and
  1480. %          if justification is not attempted.  Hence \raggedright.
  1481. \def\majorheading{\parsearg\majorheadingzzz}
  1482. \def\majorheadingzzz #1{%
  1483. {\advance\chapheadingskip by 10pt \chapbreak }%
  1484. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1485.                   \parindent=0pt\raggedright
  1486.                   \rm #1\hfill}}\bigskip \par\penalty 200}
  1487. \def\chapheading{\parsearg\chapheadingzzz}
  1488. \def\chapheadingzzz #1{\chapbreak %
  1489. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1490.                   \parindent=0pt\raggedright
  1491.                   \rm #1\hfill}}\bigskip \par\penalty 200}
  1492. \def\heading{\parsearg\secheadingi}
  1493. \def\subheading{\parsearg\subsecheadingi}
  1494. \def\subsubheading{\parsearg\subsubsecheadingi}
  1495. % These macros generate a chapter, section, etc. heading only
  1496. % (including whitespace, linebreaking, etc. around it),
  1497. % given all the information in convenient, parsed form.
  1498. %%% Args are the skip and penalty (usually negative)
  1499. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  1500. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  1501. %%% Define plain chapter starts, and page on/off switching for it
  1502. % Parameter controlling skip before chapter headings (if needed)
  1503. \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt
  1504. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  1505. \def\chappager{\par\vfill\supereject}
  1506. \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
  1507. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  1508. \def\CHAPPAGoff{
  1509. \global\let\pchapsepmacro=\chapbreak
  1510. \global\let\pagealignmacro=\chappager}
  1511. \def\CHAPPAGon{
  1512. \global\let\pchapsepmacro=\chappager
  1513. \global\let\pagealignmacro=\chappager
  1514. \global\def\HEADINGSon{\HEADINGSsingle}}
  1515. \def\CHAPPAGodd{
  1516. \global\let\pchapsepmacro=\chapoddpage
  1517. \global\let\pagealignmacro=\chapoddpage
  1518. \global\def\HEADINGSon{\HEADINGSdouble}}
  1519. \CHAPPAGon
  1520. \def\CHAPFplain{
  1521. \global\let\chapmacro=\chfplain
  1522. \global\let\unnumbchapmacro=\unnchfplain}
  1523. \def\chfplain #1#2{%
  1524.   \pchapsepmacro
  1525.     \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1526.                      \parindent=0pt\raggedright
  1527.                      \rm #2\enspace #1}%
  1528.   \bigskip
  1529.   \penalty5000
  1530. \def\unnchfplain #1{%
  1531. \pchapsepmacro %
  1532. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1533.                   \parindent=0pt\raggedright
  1534.                   \rm #1\hfill}}\bigskip \par\penalty 10000 %
  1535. \CHAPFplain % The default
  1536. \def\unnchfopen #1{%
  1537. \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1538.                        \parindent=0pt\raggedright
  1539.                        \rm #1\hfill}}\bigskip \par\penalty 10000 %
  1540. \def\chfopen #1#2{\chapoddpage {\chapfonts
  1541. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  1542. \par\penalty 5000 %
  1543. \def\CHAPFopen{
  1544. \global\let\chapmacro=\chfopen
  1545. \global\let\unnumbchapmacro=\unnchfopen}
  1546. % Parameter controlling skip before section headings.
  1547. \newskip \subsecheadingskip  \subsecheadingskip = 17pt plus 8pt minus 4pt
  1548. \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
  1549. \newskip \secheadingskip  \secheadingskip = 21pt plus 8pt minus 4pt
  1550. \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
  1551. % @paragraphindent  is defined for the Info formatting commands only.
  1552. \let\paragraphindent=\comment
  1553. % Section fonts are the base font at magstep2, which produces
  1554. % a size a bit more than 14 points in the default situation.    
  1555. \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
  1556. \def\plainsecheading #1{\secheadingi {#1}}
  1557. \def\secheadingi #1{{\advance \secheadingskip by \parskip %
  1558. \secheadingbreak}%
  1559. {\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1560.                  \parindent=0pt\raggedright
  1561.                  \rm #1\hfill}}%
  1562. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
  1563. % Subsection fonts are the base font at magstep1, 
  1564. % which produces a size of 12 points.
  1565. \def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}}
  1566. \def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip %
  1567. \subsecheadingbreak}%
  1568. {\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1569.                      \parindent=0pt\raggedright
  1570.                      \rm #1\hfill}}%
  1571. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
  1572. \def\subsubsecfonts{\subsecfonts} % Maybe this should change:
  1573.                   % Perhaps make sssec fonts scaled
  1574.                   % magstep half
  1575. \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}}
  1576. \def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip %
  1577. \subsecheadingbreak}%
  1578. {\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1579.                        \parindent=0pt\raggedright
  1580.                        \rm #1\hfill}}%
  1581. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}
  1582. \message{toc printing,}
  1583. % Finish up the main text and prepare to read what we've written
  1584. % to \contentsfile.
  1585. \newskip\contentsrightmargin \contentsrightmargin=1in
  1586. \def\startcontents#1{%
  1587.    \ifnum \pageno>0
  1588.       \pageno = -1        % Request roman numbered pages.
  1589.    \fi
  1590.    \pagealignmacro
  1591.    \immediate\closeout \contentsfile
  1592.    % Don't need to put `Contents' or `Short Contents' in the headline. 
  1593.    % It is abundantly clear what they are.
  1594.    \unnumbchapmacro{#1}\def\thischapter{}%
  1595.    \begingroup           % Set up to handle contents files properly.
  1596.       \catcode`\\=0  \catcode`\{=1  \catcode`\}=2  \catcode`\@=11
  1597.       \raggedbottom             % Worry more about breakpoints than the bottom.
  1598.       \advance\hsize by -\contentsrightmargin % Don't use the full line length.
  1599. % Normal (long) toc.
  1600. \outer\def\contents{%
  1601.    \startcontents{Table of Contents}%
  1602.       \input \jobname.toc
  1603.    \endgroup
  1604.    \vfill \eject
  1605. % And just the chapters.
  1606. \outer\def\summarycontents{%
  1607.    \startcontents{Short Contents}%
  1608.       %
  1609.       \let\chapentry = \shortchapentry
  1610.       \let\unnumbchapentry = \shortunnumberedentry
  1611.       % We want a true roman here for the page numbers.
  1612.       \secfonts
  1613.       \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
  1614.       \rm
  1615.       \advance\baselineskip by 1pt % Open it up a little.
  1616.       \def\secentry ##1##2##3##4{}
  1617.       \def\unnumbsecentry ##1##2{}
  1618.       \def\subsecentry ##1##2##3##4##5{}
  1619.       \def\unnumbsubsecentry ##1##2{}
  1620.       \def\subsubsecentry ##1##2##3##4##5##6{}
  1621.       \def\unnumbsubsubsecentry ##1##2{}
  1622.       \input \jobname.toc
  1623.    \endgroup
  1624.    \vfill \eject
  1625. \let\shortcontents = \summarycontents
  1626. % These macros generate individual entries in the table of contents.
  1627. % The first argument is the chapter or section name.
  1628. % The last argument is the page number.
  1629. % The arguments in between are the chapter number, section number, ...
  1630. % Chapter-level things, for both the long and short contents.
  1631. \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
  1632. % See comments in \dochapentry re vbox and related settings
  1633. \def\shortchapentry#1#2#3{%
  1634.    \vbox{\hyphenpenalty=10000\tolerance=5000
  1635.     \parindent=0pt\strut\raggedright
  1636.     {#2\labelspace #1}\dotfill\doshortpageno{#3}}%
  1637. \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
  1638. \def\shortunnumberedentry#1#2{%
  1639.    \vbox{\hyphenpenalty=10000\tolerance=5000
  1640.     \parindent=0pt\strut\raggedright
  1641.     #1\dotfill\doshortpageno{#2}}%
  1642. % Sections.
  1643. \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
  1644. \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
  1645. % Subsections.
  1646. \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
  1647. \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
  1648. % And subsubsections.
  1649. \def\subsubsecentry#1#2#3#4#5#6{%
  1650.   \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
  1651. \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
  1652. % This parameter controls the indentation of the various levels.
  1653. \newdimen\tocindent \tocindent = 3pc
  1654. % Now for the actual typesetting. In all these, #1 is the text and #2 is the 
  1655. % page number.
  1656. % If the toc has to be broken over pages, we would want to be at chapters 
  1657. % if at all possible; hence the \penalty.
  1658. \def\dochapentry#1#2{%
  1659.    \penalty-300 \vskip\baselineskip
  1660.    % This \vbox (and similar ones in dosecentry etc.) used to be a
  1661.    % \line; changed to permit linebreaks for long headings.  See
  1662.    % comments above \majorheading.  Here we also use \strut to
  1663.    % keep the top end of the vbox from jamming up against the previous
  1664.    % entry in the table of contents.
  1665.    \vbox{\chapentryfonts
  1666.      \hyphenpenalty=10000\tolerance=5000 % this line and next introduced
  1667.      \parindent=0pt\strut\raggedright    % with \line -> \vbox change
  1668.      #1\dotfill
  1669.      \dopageno{#2}}%
  1670.    \nobreak\vskip .25\baselineskip
  1671. \def\dosecentry#1#2{%
  1672.    \vbox{\secentryfonts \leftskip=\tocindent
  1673.     \hyphenpenalty=10000\tolerance=5000
  1674.     \parindent=0pt\strut\raggedright #1\dotfill
  1675.     \dopageno{#2}}%
  1676. \def\dosubsecentry#1#2{%
  1677.    \vbox{\subsecentryfonts \leftskip=2\tocindent
  1678.     \hyphenpenalty=10000\tolerance=5000
  1679.     \parindent=0pt\strut\raggedright #1\dotfill
  1680.     \dopageno{#2}}%
  1681. \def\dosubsubsecentry#1#2{%
  1682.    \vbox{\subsubsecentryfonts \leftskip=3\tocindent
  1683.     \hyphenpenalty=10000\tolerance=5000
  1684.     \parindent=0pt\strut\raggedright #1\dotfill
  1685.     \dopageno{#2}}%
  1686. % Space between chapter (or whatever) number and the title.
  1687. \def\labelspace{\hskip1em \relax}
  1688. \def\dopageno#1{{\rm #1}}
  1689. \def\doshortpageno#1{{\rm #1}}
  1690. \def\chapentryfonts{\secfonts \rm}
  1691. \def\secentryfonts{\textfonts}
  1692. \let\subsecentryfonts = \textfonts
  1693. \let\subsubsecentryfonts = \textfonts
  1694. \message{environments,}
  1695. % Since these characters are used in examples, it should be an even number of 
  1696. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  1697. % Furthermore, these definitions must come after we define our fonts.
  1698. \newbox\dblarrowbox    \newbox\longdblarrowbox
  1699. \newbox\pushcharbox    \newbox\bullbox
  1700. \newbox\equivbox       \newbox\errorbox
  1701. \let\ptexequiv = \equiv
  1702. %{\tentt
  1703. %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
  1704. %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
  1705. %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
  1706. %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
  1707. % Adapted from the manmac format (p.420 of TeXbook)
  1708. %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
  1709. %                                      depth .1ex\hfil}
  1710. \def\point{$\star$}
  1711. \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  1712. \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
  1713. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  1714. \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  1715. % Adapted from the TeXbook's \boxit.
  1716. {\tentt \global\dimen0 = 3em}% Width of the box.
  1717. \dimen2 = .55pt % Thickness of rules
  1718. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  1719. \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
  1720. \global\setbox\errorbox=\hbox to \dimen0{\hfil
  1721.    \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  1722.    \advance\hsize by -2\dimen2 % Rules.
  1723.    \vbox{
  1724.       \hrule height\dimen2
  1725.       \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
  1726.          \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  1727.          \kern3pt\vrule width\dimen2}% Space to right.
  1728.       \hrule height\dimen2}
  1729.     \hfil}
  1730. % The @error{} command.
  1731. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  1732. % @tex ... @end tex    escapes into raw Tex temporarily.
  1733. % One exception: @ is still an escape character, so that @end tex works.
  1734. % But \@ or @@ will get a plain tex @ character.
  1735. \def\tex{\begingroup
  1736. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  1737. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  1738. \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
  1739. \catcode `\%=14
  1740. \catcode 43=12
  1741. \catcode`\"=12
  1742. \catcode`\==12
  1743. \catcode`\|=12
  1744. \catcode`\<=12
  1745. \catcode`\>=12
  1746. \escapechar=`\\
  1747. \let\{=\ptexlbrace
  1748. \let\}=\ptexrbrace
  1749. \let\.=\ptexdot
  1750. \let\*=\ptexstar
  1751. \let\dots=\ptexdots
  1752. \def\@{@}%
  1753. \let\bullet=\ptexbullet
  1754. \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
  1755. \let\L=\ptexL
  1756. \let\Etex=\endgroup}
  1757. % Define @lisp ... @endlisp.
  1758. % @lisp does a \begingroup so it can rebind things,
  1759. % including the definition of @endlisp (which normally is erroneous).
  1760. % Amount to narrow the margins by for @lisp.
  1761. \newskip\lispnarrowing \lispnarrowing=0.4in
  1762. % This is the definition that ^M gets inside @lisp
  1763. % phr: changed space to \null, to avoid overfull hbox problems.
  1764. {\obeyspaces%
  1765. \gdef\lisppar{\null\endgraf}}
  1766. % Cause \obeyspaces to make each Space cause a word-separation
  1767. % rather than the default which is that it acts punctuation.
  1768. % This is because space in tt font looks funny.
  1769. {\obeyspaces %
  1770. \gdef\sepspaces{\def {\ }}}
  1771. \newskip\aboveenvskipamount \aboveenvskipamount= 0pt
  1772. \def\aboveenvbreak{{\advance\aboveenvskipamount by \parskip
  1773. \endgraf \ifdim\lastskip<\aboveenvskipamount
  1774. \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}}
  1775. \def\afterenvbreak{\endgraf \ifdim\lastskip<\aboveenvskipamount
  1776. \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}
  1777. % \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins.
  1778. \let\nonarrowing=\relax
  1779. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1780. % \cartouche: draw rectangle w/rounded corners around argument
  1781. \font\circle=lcircle10
  1782. \newdimen\circthick
  1783. \newdimen\cartouter\newdimen\cartinner
  1784. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  1785. \circthick=\fontdimen8\circle
  1786. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  1787. \def\ctr{{\hskip 6pt\circle\char'010}}
  1788. \def\cbl{{\circle\char'012\hskip -6pt}}
  1789. \def\cbr{{\hskip 6pt\circle\char'011}}
  1790. \def\carttop{\hbox to \cartouter{\hskip\lskip
  1791.     \ctl\leaders\hrule height\circthick\hfil\ctr
  1792.     \hskip\rskip}}
  1793. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  1794.     \cbl\leaders\hrule height\circthick\hfil\cbr
  1795.     \hskip\rskip}}
  1796. \newskip\lskip\newskip\rskip
  1797. \long\def\cartouche{%
  1798. \begingroup
  1799.     \lskip=\leftskip \rskip=\rightskip
  1800.     \leftskip=0pt\rightskip=0pt %we want these *outside*.
  1801.     \cartinner=\hsize \advance\cartinner by-\lskip 
  1802.                \advance\cartinner by-\rskip
  1803.     \cartouter=\hsize
  1804.     \advance\cartouter by 18pt % allow for 3pt kerns on either
  1805. %                     side, and for 6pt waste from
  1806. %                     each corner char
  1807.     \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  1808.     % Flag to tell @lisp, etc., not to narrow margin.
  1809.     \let\nonarrowing=\comment
  1810.     \vbox\bgroup
  1811.         \baselineskip=0pt\parskip=0pt\lineskip=0pt
  1812.         \carttop
  1813.         \hbox\bgroup
  1814.             \hskip\lskip
  1815.             \vrule\kern3pt
  1816.             \vbox\bgroup
  1817.                 \hsize=\cartinner
  1818.                 \kern3pt
  1819.                 \begingroup
  1820.                     \baselineskip=\normbskip
  1821.                     \lineskip=\normlskip
  1822.                     \parskip=\normpskip
  1823.                     \vskip -\parskip
  1824. \def\Ecartouche{%
  1825.                 \endgroup
  1826.                 \kern3pt
  1827.             \egroup
  1828.             \kern3pt\vrule
  1829.             \hskip\rskip
  1830.         \egroup
  1831.         \cartbot
  1832.     \egroup
  1833. \endgroup
  1834. \def\lisp{\aboveenvbreak
  1835. \begingroup\inENV % This group ends at the end of the @lisp body
  1836. \hfuzz=12truept % Don't be fussy
  1837. % Make spaces be word-separators rather than space tokens.
  1838. \sepspaces %
  1839. % Single space lines
  1840. \singlespace %
  1841. % The following causes blank lines not to be ignored
  1842. % by adding a space to the end of each line.
  1843. \let\par=\lisppar
  1844. \def\Elisp{\endgroup\afterenvbreak}%
  1845. \parskip=0pt
  1846. % @cartouche defines \nonarrowing to inhibit narrowing
  1847. % at next level down.
  1848. \ifx\nonarrowing\relax
  1849. \advance \leftskip by \lispnarrowing
  1850. \exdentamount=\lispnarrowing
  1851. \let\exdent=\nofillexdent
  1852. \let\nonarrowing=\relax
  1853. \parindent=0pt
  1854. \obeyspaces \obeylines \tt \rawbackslash
  1855. \def\next##1{}\next}
  1856. \let\example=\lisp
  1857. \def\Eexample{\Elisp}
  1858. \let\smallexample=\lisp
  1859. \def\Esmallexample{\Elisp}
  1860. % Macro for 9 pt. examples, necessary to print with 5" lines.
  1861. % From Pavel@xerox.  This is not really used unless the
  1862. % @smallbook command is given.
  1863. \def\smalllispx{\aboveenvbreak\begingroup\inENV
  1864. %            This group ends at the end of the @lisp body
  1865. \hfuzz=12truept % Don't be fussy
  1866. % Make spaces be word-separators rather than space tokens.
  1867. \sepspaces %
  1868. % Single space lines
  1869. \singlespace %
  1870. % The following causes blank lines not to be ignored
  1871. % by adding a space to the end of each line.
  1872. \let\par=\lisppar
  1873. \def\Esmalllisp{\endgroup\afterenvbreak}%
  1874. %%%% Smaller baseline skip for small examples.
  1875. \baselineskip 10pt
  1876. \parskip=0pt
  1877. % @cartouche defines \nonarrowing to inhibit narrowing
  1878. % at next level down.
  1879. \ifx\nonarrowing\relax
  1880. \advance \leftskip by \lispnarrowing
  1881. \exdentamount=\lispnarrowing
  1882. \let\exdent=\nofillexdent
  1883. \let\nonarrowing=\relax
  1884. \parindent=0pt
  1885. \obeyspaces \obeylines \ninett \indexfonts \rawbackslash
  1886. \def\next##1{}\next}
  1887. % This is @display; same as @lisp except use roman font.
  1888. \def\display{\begingroup\inENV %This group ends at the end of the @display body
  1889. \aboveenvbreak
  1890. % Make spaces be word-separators rather than space tokens.
  1891. \sepspaces %
  1892. % Single space lines
  1893. \singlespace %
  1894. % The following causes blank lines not to be ignored
  1895. % by adding a space to the end of each line.
  1896. \let\par=\lisppar
  1897. \def\Edisplay{\endgroup\afterenvbreak}%
  1898. \parskip=0pt
  1899. % @cartouche defines \nonarrowing to inhibit narrowing
  1900. % at next level down.
  1901. \ifx\nonarrowing\relax
  1902. \advance \leftskip by \lispnarrowing
  1903. \exdentamount=\lispnarrowing
  1904. \let\exdent=\nofillexdent
  1905. \let\nonarrowing=\relax
  1906. \parindent=0pt
  1907. \obeyspaces \obeylines
  1908. \def\next##1{}\next}
  1909. % This is @format; same as @lisp except use roman font and don't narrow margins
  1910. \def\format{\begingroup\inENV %This group ends at the end of the @format body
  1911. \aboveenvbreak
  1912. % Make spaces be word-separators rather than space tokens.
  1913. \sepspaces %
  1914. \singlespace %
  1915. % The following causes blank lines not to be ignored
  1916. % by adding a space to the end of each line.
  1917. \let\par=\lisppar
  1918. \def\Eformat{\endgroup\afterenvbreak}
  1919. \parskip=0pt \parindent=0pt
  1920. \obeyspaces \obeylines
  1921. \def\next##1{}\next}
  1922. % @flushleft and @flushright
  1923. \def\flushleft{%
  1924. \begingroup\inENV %This group ends at the end of the @format body
  1925. \aboveenvbreak
  1926. % Make spaces be word-separators rather than space tokens.
  1927. \sepspaces %
  1928. % The following causes blank lines not to be ignored
  1929. % by adding a space to the end of each line.
  1930. % This also causes @ to work when the directive name
  1931. % is terminated by end of line.
  1932. \let\par=\lisppar
  1933. \def\Eflushleft{\endgroup\afterenvbreak}%
  1934. \parskip=0pt \parindent=0pt
  1935. \obeyspaces \obeylines
  1936. \def\next##1{}\next}
  1937. \def\flushright{%
  1938. \begingroup\inENV %This group ends at the end of the @format body
  1939. \aboveenvbreak
  1940. % Make spaces be word-separators rather than space tokens.
  1941. \sepspaces %
  1942. % The following causes blank lines not to be ignored
  1943. % by adding a space to the end of each line.
  1944. % This also causes @ to work when the directive name
  1945. % is terminated by end of line.
  1946. \let\par=\lisppar
  1947. \def\Eflushright{\endgroup\afterenvbreak}%
  1948. \parskip=0pt \parindent=0pt
  1949. \advance \leftskip by 0pt plus 1fill
  1950. \obeyspaces \obeylines
  1951. \def\next##1{}\next}
  1952. % @quotation - narrow the margins.
  1953. \def\quotation{%
  1954. \begingroup\inENV %This group ends at the end of the @quotation body
  1955. {\parskip=0pt  % because we will skip by \parskip too, later
  1956. \aboveenvbreak}%
  1957. \singlespace
  1958. \parindent=0pt
  1959. \def\Equotation{\par\endgroup\afterenvbreak}%
  1960. % @cartouche defines \nonarrowing to inhibit narrowing
  1961. % at next level down.
  1962. \ifx\nonarrowing\relax
  1963. \advance \leftskip by \lispnarrowing
  1964. \advance \rightskip by \lispnarrowing
  1965. \exdentamount=\lispnarrowing
  1966. \let\nonarrowing=\relax
  1967. \message{defuns,}
  1968. % Define formatter for defuns
  1969. % First, allow user to change definition object font (\df) internally
  1970. \def\setdeffont #1 {\csname DEF#1\endcsname}
  1971. \newskip\defbodyindent \defbodyindent=.4in
  1972. \newskip\defargsindent \defargsindent=50pt
  1973. \newskip\deftypemargin \deftypemargin=12pt
  1974. \newskip\deflastargmargin \deflastargmargin=18pt
  1975. \newcount\parencount
  1976. % define \functionparens, which makes ( and ) and & do special things.
  1977. % \functionparens affects the group it is contained in.
  1978. \def\activeparens{%
  1979. \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
  1980. \catcode`\[=\active \catcode`\]=\active}
  1981. {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
  1982. \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
  1983. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  1984. % Definitions of (, ) and & used in args for functions.
  1985. % This is the definition of ( outside of all parentheses.
  1986. \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
  1987. \global\advance\parencount by 1 }
  1988. % This is the definition of ( when already inside a level of parens.
  1989. \gdef\opnested{\char`\(\global\advance\parencount by 1 }
  1990. \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
  1991. % also in that case restore the outer-level definition of (.
  1992. \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
  1993. \global\advance \parencount by -1 }
  1994. % If we encounter &foo, then turn on ()-hacking afterwards
  1995. \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ }
  1996. \gdef\normalparens{\boldbrax\let&=\ampnr}
  1997. } % End of definition inside \activeparens
  1998. %% These parens (in \boldbrax) actually are a little bolder than the
  1999. %% contained text.  This is especially needed for [ and ]
  2000. \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
  2001. \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
  2002. % First, defname, which formats the header line itself.
  2003. % #1 should be the function name.
  2004. % #2 should be the type of definition, such as "Function".
  2005. \def\defname #1#2{%
  2006. % Get the values of \leftskip and \rightskip as they were
  2007. % outside the @def...
  2008. \dimen2=\leftskip
  2009. \advance\dimen2 by -\defbodyindent
  2010. \dimen3=\rightskip
  2011. \advance\dimen3 by -\defbodyindent
  2012. \noindent        %
  2013. \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
  2014. \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
  2015. \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
  2016. \parshape 2 0in \dimen0 \defargsindent \dimen1     %
  2017. % Now output arg 2 ("Function" or some such)
  2018. % ending at \deftypemargin from the right margin,
  2019. % but stuck inside a box of width 0 so it does not interfere with linebreaking
  2020. {% Adjust \hsize to exclude the ambient margins,
  2021. % so that \rightline will obey them.
  2022. \advance \hsize by -\dimen2 \advance \hsize by -\dimen3
  2023. \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
  2024. % Make all lines underfull and no complaints:
  2025. \tolerance=10000 \hbadness=10000    
  2026. \advance\leftskip by -\defbodyindent
  2027. \exdentamount=\defbodyindent
  2028. {\df #1}\enskip        % Generate function name
  2029. % Actually process the body of a definition
  2030. % #1 should be the terminating control sequence, such as \Edefun.
  2031. % #2 should be the "another name" control sequence, such as \defunx.
  2032. % #3 should be the control sequence that actually processes the header,
  2033. %    such as \defunheader.
  2034. \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
  2035. \medbreak %
  2036. % Define the end token that this defining construct specifies
  2037. % so that it will exit this group.
  2038. \def#1{\endgraf\endgroup\medbreak}%
  2039. \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
  2040. \parindent=0in
  2041. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2042. \exdentamount=\defbodyindent
  2043. \begingroup %
  2044. \catcode 61=\active %
  2045. \obeylines\activeparens\spacesplit#3}
  2046. \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
  2047. \medbreak %
  2048. % Define the end token that this defining construct specifies
  2049. % so that it will exit this group.
  2050. \def#1{\endgraf\endgroup\medbreak}%
  2051. \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
  2052. \parindent=0in
  2053. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2054. \exdentamount=\defbodyindent
  2055. \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
  2056. \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
  2057. \medbreak %
  2058. % Define the end token that this defining construct specifies
  2059. % so that it will exit this group.
  2060. \def#1{\endgraf\endgroup\medbreak}%
  2061. \def#2##1 ##2 {\def#4{##1}%
  2062. \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
  2063. \parindent=0in
  2064. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2065. \exdentamount=\defbodyindent
  2066. \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
  2067. % These parsing functions are similar to the preceding ones
  2068. % except that they do not make parens into active characters.
  2069. % These are used for "variables" since they have no arguments.
  2070. \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
  2071. \medbreak %
  2072. % Define the end token that this defining construct specifies
  2073. % so that it will exit this group.
  2074. \def#1{\endgraf\endgroup\medbreak}%
  2075. \def#2{\begingroup\obeylines\spacesplit#3}%
  2076. \parindent=0in
  2077. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2078. \exdentamount=\defbodyindent
  2079. \begingroup %
  2080. \catcode 61=\active %
  2081. \obeylines\spacesplit#3}
  2082. \def\defvrparsebody #1#2#3#4 {\begingroup\inENV %
  2083. \medbreak %
  2084. % Define the end token that this defining construct specifies
  2085. % so that it will exit this group.
  2086. \def#1{\endgraf\endgroup\medbreak}%
  2087. \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
  2088. \parindent=0in
  2089. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2090. \exdentamount=\defbodyindent
  2091. \begingroup\obeylines\spacesplit{#3{#4}}}
  2092. \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
  2093. \medbreak %
  2094. % Define the end token that this defining construct specifies
  2095. % so that it will exit this group.
  2096. \def#1{\endgraf\endgroup\medbreak}%
  2097. \def#2##1 ##2 {\def#4{##1}%
  2098. \begingroup\obeylines\spacesplit{#3{##2}}}%
  2099. \parindent=0in
  2100. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2101. \exdentamount=\defbodyindent
  2102. \begingroup\obeylines\spacesplit{#3{#5}}}
  2103. % Split up #2 at the first space token.
  2104. % call #1 with two arguments:
  2105. %  the first is all of #2 before the space token,
  2106. %  the second is all of #2 after that space token.
  2107. % If #2 contains no space token, all of it is passed as the first arg
  2108. % and the second is passed as empty.
  2109. {\obeylines
  2110. \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
  2111. \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
  2112. \ifx\relax #3%
  2113. #1{#2}{}\else #1{#2}{#3#4}\fi}}
  2114. % So much for the things common to all kinds of definitions.
  2115. % Define @defun.
  2116. % First, define the processing that is wanted for arguments of \defun
  2117. % Use this to expand the args and terminate the paragraph they make up
  2118. \def\defunargs #1{\functionparens \sl
  2119. % Expand, preventing hyphenation at `-' chars.
  2120. % Note that groups don't affect changes in \hyphenchar.
  2121. \hyphenchar\tensl=0
  2122. \hyphenchar\tensl=45
  2123. \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
  2124. \interlinepenalty=10000
  2125. \advance\rightskip by 0pt plus 1fil
  2126. \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
  2127. \def\deftypefunargs #1{%
  2128. % Expand, preventing hyphenation at `-' chars.
  2129. % Note that groups don't affect changes in \hyphenchar.
  2130. \functionparens
  2131. \code{#1}%
  2132. \interlinepenalty=10000
  2133. \advance\rightskip by 0pt plus 1fil
  2134. \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
  2135. % Do complete processing of one @defun or @defunx line already parsed.
  2136. % @deffn Command forward-char nchars
  2137. \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
  2138. \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
  2139. \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
  2140. \catcode 61=\other % Turn off change made in \defparsebody
  2141. % @defun == @deffn Function
  2142. \def\defun{\defparsebody\Edefun\defunx\defunheader}
  2143. \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2144. \begingroup\defname {#1}{Function}%
  2145. \defunargs {#2}\endgroup %
  2146. \catcode 61=\other % Turn off change made in \defparsebody
  2147. % @deftypefun int foobar (int @var{foo}, float @var{bar})
  2148. \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
  2149. % #1 is the data type.  #2 is the name and args.
  2150. \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
  2151. % #1 is the data type, #2 the name, #3 the args.
  2152. \def\deftypefunheaderx #1#2 #3\relax{%
  2153. \doind {fn}{\code{#2}}% Make entry in function index
  2154. \begingroup\defname {\code{#1} #2}{Function}%
  2155. \deftypefunargs {#3}\endgroup %
  2156. \catcode 61=\other % Turn off change made in \defparsebody
  2157. % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
  2158. \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
  2159. % #1 is the classification.  #2 is the data type.  #3 is the name and args.
  2160. \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
  2161. % #1 is the classification, #2 the data type, #3 the name, #4 the args.
  2162. \def\deftypefnheaderx #1#2#3 #4\relax{%
  2163. \doind {fn}{\code{#3}}% Make entry in function index
  2164. \begingroup\defname {\code{#2} #3}{#1}%
  2165. \deftypefunargs {#4}\endgroup %
  2166. \catcode 61=\other % Turn off change made in \defparsebody
  2167. % @defmac == @deffn Macro
  2168. \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
  2169. \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2170. \begingroup\defname {#1}{Macro}%
  2171. \defunargs {#2}\endgroup %
  2172. \catcode 61=\other % Turn off change made in \defparsebody
  2173. % @defspec == @deffn Special Form
  2174. \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
  2175. \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2176. \begingroup\defname {#1}{Special Form}%
  2177. \defunargs {#2}\endgroup %
  2178. \catcode 61=\other % Turn off change made in \defparsebody
  2179. % This definition is run if you use @defunx
  2180. % anywhere other than immediately after a @defun or @defunx.
  2181. \def\deffnx #1 {\errmessage{@deffnx in invalid context}}
  2182. \def\defunx #1 {\errmessage{@defunx in invalid context}}
  2183. \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
  2184. \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
  2185. \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
  2186. \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
  2187. % @defmethod, and so on
  2188. % @defop {Funny Method} foo-class frobnicate argument
  2189. \def\defop #1 {\def\defoptype{#1}%
  2190. \defopparsebody\Edefop\defopx\defopheader\defoptype}
  2191. \def\defopheader #1#2#3{%
  2192. \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
  2193. \begingroup\defname {#2}{\defoptype{} on #1}%
  2194. \defunargs {#3}\endgroup %
  2195. % @defmethod == @defop Method
  2196. \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
  2197. \def\defmethodheader #1#2#3{%
  2198. \dosubind {fn}{\code{#2}}{on #1}% entry in function index
  2199. \begingroup\defname {#2}{Method on #1}%
  2200. \defunargs {#3}\endgroup %
  2201. % @defcv {Class Option} foo-class foo-flag
  2202. \def\defcv #1 {\def\defcvtype{#1}%
  2203. \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
  2204. \def\defcvarheader #1#2#3{%
  2205. \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
  2206. \begingroup\defname {#2}{\defcvtype{} of #1}%
  2207. \defvarargs {#3}\endgroup %
  2208. % @defivar == @defcv {Instance Variable}
  2209. \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
  2210. \def\defivarheader #1#2#3{%
  2211. \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
  2212. \begingroup\defname {#2}{Instance Variable of #1}%
  2213. \defvarargs {#3}\endgroup %
  2214. % These definitions are run if you use @defmethodx, etc.,
  2215. % anywhere other than immediately after a @defmethod, etc.
  2216. \def\defopx #1 {\errmessage{@defopx in invalid context}}
  2217. \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
  2218. \def\defcvx #1 {\errmessage{@defcvx in invalid context}}
  2219. \def\defivarx #1 {\errmessage{@defivarx in invalid context}}
  2220. % Now @defvar
  2221. % First, define the processing that is wanted for arguments of @defvar.
  2222. % This is actually simple: just print them in roman.
  2223. % This must expand the args and terminate the paragraph they make up
  2224. \def\defvarargs #1{\normalparens #1%
  2225. \interlinepenalty=10000
  2226. \endgraf\penalty 10000\vskip -\parskip\penalty 10000}
  2227. % @defvr Counter foo-count
  2228. \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
  2229. \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
  2230. \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
  2231. % @defvar == @defvr Variable
  2232. \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
  2233. \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
  2234. \begingroup\defname {#1}{Variable}%
  2235. \defvarargs {#2}\endgroup %
  2236. % @defopt == @defvr {User Option}
  2237. \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
  2238. \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
  2239. \begingroup\defname {#1}{User Option}%
  2240. \defvarargs {#2}\endgroup %
  2241. % @deftypevar int foobar
  2242. \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
  2243. % #1 is the data type.  #2 is the name.
  2244. \def\deftypevarheader #1#2{%
  2245. \doind {vr}{\code{#2}}% Make entry in variables index
  2246. \begingroup\defname {\code{#1} #2}{Variable}%
  2247. \interlinepenalty=10000
  2248. \endgraf\penalty 10000\vskip -\parskip\penalty 10000
  2249. \endgroup}
  2250. % @deftypevr {Global Flag} int enable
  2251. \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
  2252. \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
  2253. \begingroup\defname {\code{#2} #3}{#1}
  2254. \interlinepenalty=10000
  2255. \endgraf\penalty 10000\vskip -\parskip\penalty 10000
  2256. \endgroup}
  2257. % This definition is run if you use @defvarx
  2258. % anywhere other than immediately after a @defvar or @defvarx.
  2259. \def\defvrx #1 {\errmessage{@defvrx in invalid context}}
  2260. \def\defvarx #1 {\errmessage{@defvarx in invalid context}}
  2261. \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
  2262. \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
  2263. \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
  2264. % Now define @deftp
  2265. % Args are printed in bold, a slight difference from @defvar.
  2266. \def\deftpargs #1{\bf \defvarargs{#1}}
  2267. % @deftp Class window height width ...
  2268. \def\deftp{\defvrparsebody\Edeftp\deftpx\deftpheader}
  2269. \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
  2270. \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
  2271. % This definition is run if you use @deftpx, etc
  2272. % anywhere other than immediately after a @deftp, etc.
  2273. \def\deftpx #1 {\errmessage{@deftpx in invalid context}}
  2274. \message{cross reference,}
  2275. % Define cross-reference macros
  2276. \newwrite \auxfile
  2277. \newif\ifhavexrefs  % True if xref values are known.
  2278. \newif\ifwarnedxrefs  % True if we warned once that they aren't known.
  2279. % \setref{foo} defines a cross-reference point named foo.
  2280. \def\setref#1{%
  2281. %\dosetq{#1-title}{Ytitle}%
  2282. \dosetq{#1-pg}{Ypagenumber}%
  2283. \dosetq{#1-snt}{Ysectionnumberandtype}}
  2284. \def\unnumbsetref#1{%
  2285. %\dosetq{#1-title}{Ytitle}%
  2286. \dosetq{#1-pg}{Ypagenumber}%
  2287. \dosetq{#1-snt}{Ynothing}}
  2288. \def\appendixsetref#1{%
  2289. %\dosetq{#1-title}{Ytitle}%
  2290. \dosetq{#1-pg}{Ypagenumber}%
  2291. \dosetq{#1-snt}{Yappendixletterandtype}}
  2292. % \xref, \pxref, and \ref generate cross-references to specified points.
  2293. % For \xrefX, #1 is the node name, #2 the name of the Info
  2294. % cross-reference, #3 the printed node name, #4 the name of the Info
  2295. % file, #5 the name of the printed manual.  All but the node name can be
  2296. % omitted.
  2297. \def\pxref#1{see \xrefX[#1,,,,,,,]}
  2298. \def\xref#1{See \xrefX[#1,,,,,,,]}
  2299. \def\ref#1{\xrefX[#1,,,,,,,]}
  2300. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup%
  2301. \def\printedmanual{\ignorespaces #5}%
  2302. \def\printednodename{\ignorespaces #3}%
  2303. \setbox1=\hbox{\printedmanual}%
  2304. \setbox0=\hbox{\printednodename}%
  2305. \ifdim \wd0=0pt%
  2306. \def\printednodename{\ignorespaces #1}%
  2307. %%% Uncommment the following line to make the actual chapter or section title
  2308. %%% appear inside the square brackets.
  2309. %\def\printednodename{#1-title}%
  2310. % If we use \unhbox0 and \unhbox1 to print the node names, TeX does
  2311. % not insert empty discretionaries after hyphens, which means that it
  2312. % will not find a line break at a hyphen in a node names.  Since some
  2313. % manuals are best written with fairly long node names, containing
  2314. % hyphens, this is a loss.  Therefore, we simply give the text of
  2315. % the node name again, so it is as if TeX is seeing it for the first
  2316. % time.
  2317. \ifdim \wd1>0pt
  2318. section ``\printednodename'' in \cite{\printedmanual}%
  2319. \else%
  2320. \turnoffactive%
  2321. \refx{#1-snt}{} [\printednodename], page\tie\refx{#1-pg}{}%
  2322. \endgroup}
  2323. % \dosetq is the interface for calls from other macros
  2324. % Use \turnoffactive so that punctuation chars such as underscore
  2325. % work in node names.
  2326. \def\dosetq #1#2{{\let\folio=0 \turnoffactive%
  2327. \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
  2328. \next}}
  2329. % \internalsetq {foo}{page} expands into
  2330. % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
  2331. % When the aux file is read, ' is the escape character
  2332. \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
  2333. % Things to be expanded by \internalsetq
  2334. \def\Ypagenumber{\folio}
  2335. \def\Ytitle{\thischapter}
  2336. \def\Ynothing{}
  2337. \def\Ysectionnumberandtype{%
  2338. \ifnum\secno=0 Chapter\xreftie\the\chapno %
  2339. \else \ifnum \subsecno=0 Section\xreftie\the\chapno.\the\secno %
  2340. \else \ifnum \subsubsecno=0 %
  2341. Section\xreftie\the\chapno.\the\secno.\the\subsecno %
  2342. \else %
  2343. Section\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
  2344. \fi \fi \fi }
  2345. \def\Yappendixletterandtype{%
  2346. \ifnum\secno=0 Appendix\xreftie'char\the\appendixno{}%
  2347. \else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %
  2348. \else \ifnum \subsubsecno=0 %
  2349. Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
  2350. \else %
  2351. Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
  2352. \fi \fi \fi }
  2353. \gdef\xreftie{'tie}
  2354. % Use TeX 3.0's \inputlineno to get the line number, for better error
  2355. % messages, but if we're using an old version of TeX, don't do anything.
  2356. \ifx\inputlineno\thisisundefined
  2357.   \let\linenumber = \empty % Non-3.0.
  2358. \else
  2359.   \def\linenumber{\the\inputlineno:\space}
  2360. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  2361. % If its value is nonempty, SUFFIX is output afterward.
  2362. \def\refx#1#2{%
  2363.   \expandafter\ifx\csname X#1\endcsname\relax
  2364.     % If not defined, say something at least.
  2365.     $\langle$un\-de\-fined$\rangle$%
  2366.     \ifhavexrefs
  2367.       \message{\linenumber Undefined cross reference `#1'.}%
  2368.     \else
  2369.       \ifwarnedxrefs\else
  2370.         \global\warnedxrefstrue
  2371.         \message{Cross reference values unknown; you must run TeX again.}%
  2372.       \fi
  2373.     \fi
  2374.   \else
  2375.     % It's defined, so just use it.
  2376.     \csname X#1\endcsname
  2377.   \fi
  2378.   #2% Output the suffix in any case.
  2379. % Read the last existing aux file, if any.  No error if none exists.
  2380. % This is the macro invoked by entries in the aux file.
  2381. \def\xrdef #1#2{
  2382. {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
  2383. \def\readauxfile{%
  2384. \begingroup
  2385. \catcode `\^^@=\other
  2386. \catcode `\
  2387. =\other
  2388. \catcode `\
  2389. =\other
  2390. \catcode `\^^C=\other
  2391. \catcode `\^^D=\other
  2392. \catcode `\^^E=\other
  2393. \catcode `\^^F=\other
  2394. \catcode `\^^G=\other
  2395. \catcode `\^^H=\other
  2396. \catcode `\
  2397. =\other
  2398. \catcode `\^^L=\other
  2399. \catcode `\
  2400. =\other
  2401. \catcode `\
  2402. =\other
  2403. \catcode `\
  2404. =\other
  2405. \catcode `\
  2406. =\other
  2407. \catcode `\
  2408. =\other
  2409. \catcode `\
  2410. =\other
  2411. \catcode `\
  2412. =\other
  2413. \catcode `\
  2414. =\other
  2415. \catcode `\
  2416. =\other
  2417. \catcode `\
  2418. =\other
  2419. \catcode `\
  2420. =\other
  2421. \catcode `\
  2422. =\other
  2423. \catcode 26=\other
  2424. \catcode `\^^[=\other
  2425. \catcode `\^^\=\other
  2426. \catcode `\^^]=\other
  2427. \catcode `\^^^=\other
  2428. \catcode `\^^_=\other
  2429. \catcode `\@=\other
  2430. \catcode `\^=\other
  2431. \catcode `\~=\other
  2432. \catcode `\[=\other
  2433. \catcode `\]=\other
  2434. \catcode`\"=\other
  2435. \catcode`\_=\other
  2436. \catcode`\|=\other
  2437. \catcode`\<=\other
  2438. \catcode`\>=\other
  2439. \catcode `\$=\other
  2440. \catcode `\#=\other
  2441. \catcode `\&=\other
  2442. % the aux file uses ' as the escape.
  2443. % Turn off \ as an escape so we do not lose on
  2444. % entries which were dumped with control sequences in their names.
  2445. % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
  2446. % Reference to such entries still does not work the way one would wish,
  2447. % but at least they do not bomb out when the aux file is read in.
  2448. \catcode `\{=1 \catcode `\}=2
  2449. \catcode `\%=\other
  2450. \catcode `\'=0
  2451. \catcode `\\=\other
  2452. \openin 1 \jobname.aux
  2453. \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
  2454. % Open the new aux file.  Tex will close it automatically at exit.
  2455. \openout \auxfile=\jobname.aux
  2456. \endgroup}
  2457. % Footnotes.
  2458. \newcount \footnoteno
  2459. % The trailing space in the following definition for supereject is
  2460. % vital for proper filling; pages come out unaligned when you do a
  2461. % pagealignmacro call if that space before the closing brace is
  2462. % removed.
  2463. \def\supereject{\par\penalty -20000\footnoteno =0 }
  2464. % @footnotestyle is meaningful for info output only..
  2465. \let\footnotestyle=\comment
  2466. \let\ptexfootnote=\footnote
  2467. {\catcode `\@=11
  2468. \long\gdef\footnote #1{\global\advance \footnoteno by \@ne
  2469. \unskip
  2470. \edef\thisfootno{$^{\the\footnoteno}$}%
  2471. \let\@sf\empty
  2472. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  2473. \thisfootno\@sf \footnotezzz{#1}}
  2474. % \parsearg\footnotezzz}
  2475. \long\gdef\footnotezzz #1{\insert\footins{
  2476. \interlinepenalty\interfootnotelinepenalty
  2477. \splittopskip\ht\strutbox % top baseline for broken footnotes
  2478. \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
  2479. \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
  2480. \footstrut\parindent=\defaultparindent\hang\textindent{\thisfootno}#1\strut}}
  2481. }%end \catcode `\@=11
  2482. % End of control word definitions.
  2483. \message{and turning on texinfo input format.}
  2484. \def\openindices{%
  2485.    \newindex{cp}%
  2486.    \newcodeindex{fn}%
  2487.    \newcodeindex{vr}%
  2488.    \newcodeindex{tp}%
  2489.    \newcodeindex{ky}%
  2490.    \newcodeindex{pg}%
  2491. % Set some numeric style parameters, for 8.5 x 11 format.
  2492. %\hsize = 6.5in
  2493. \newdimen\defaultparindent \defaultparindent = 15pt
  2494. \parindent = \defaultparindent
  2495. \parskip 18pt plus 1pt
  2496. \baselineskip 15pt
  2497. \advance\topskip by 1.2cm
  2498. % Prevent underfull vbox error messages.
  2499. \vbadness=10000
  2500. % Following George Bush, just get rid of widows and orphans.
  2501. \widowpenalty=10000
  2502. \clubpenalty=10000
  2503. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  2504. % using an old version of TeX, don't do anything.  We want the amount of
  2505. % stretch added to depend on the line length, hence the dependence on
  2506. % \hsize.  This makes it come to about 9pt for the 8.5x11 format.
  2507. \ifx\emergencystretch\thisisundefined \else
  2508.   \emergencystretch = \hsize
  2509.   \divide\emergencystretch by 45
  2510. % Use @smallbook to reset parameters for 7x9.5 format  (or else 7x9.25)
  2511. \def\smallbook{
  2512. \global\lispnarrowing = 0.3in
  2513. \global\baselineskip 12pt
  2514. \global\parskip 3pt plus 1pt
  2515. \global\hsize = 5in
  2516. \global\doublecolumnhsize=2.4in \global\doublecolumnvsize=15.0in
  2517. \global\vsize=7.5in
  2518. \global\tolerance=700
  2519. \global\hfuzz=1pt
  2520. \global\contentsrightmargin=0pt
  2521. \global\pagewidth=\hsize
  2522. \global\pageheight=\vsize
  2523. \global\let\smalllisp=\smalllispx
  2524. \global\let\smallexample=\smalllispx
  2525. \global\def\Esmallexample{\Esmalllisp}
  2526. % Use @afourpaper to print on European A4 paper.
  2527. \def\afourpaper{
  2528. \global\tolerance=700
  2529. \global\hfuzz=1pt
  2530. \global\baselineskip=12pt
  2531. \global\parskip 15pt plus 1pt
  2532. \global\vsize= 53\baselineskip
  2533. \advance\vsize by \topskip
  2534. %\global\hsize=   5.85in     % A4 wide 10pt
  2535. \global\hsize=  6.5in
  2536. \global\outerhsize=\hsize
  2537. \global\advance\outerhsize by 0.5in
  2538. \global\outervsize=\vsize
  2539. \global\advance\outervsize by 0.6in
  2540. \global\doublecolumnhsize=\hsize
  2541. \global\divide\doublecolumnhsize by 2
  2542. \global\advance\doublecolumnhsize by -0.1in
  2543. \global\doublecolumnvsize=\vsize
  2544. \global\multiply\doublecolumnvsize by 2
  2545. \global\advance\doublecolumnvsize by 0.1in
  2546. \global\pagewidth=\hsize
  2547. \global\pageheight=\vsize
  2548. %% For a final copy, take out the rectangles
  2549. %% that mark overfull boxes (in case you have decided
  2550. %% that the text looks ok even though it passes the margin).
  2551. \def\finalout{\overfullrule=0pt}
  2552. % Define macros to output various characters with catcode for normal text.
  2553. \catcode`\"=\other
  2554. \catcode`\~=\other
  2555. \catcode`\^=\other
  2556. \catcode`\_=\other
  2557. \catcode`\|=\other
  2558. \catcode`\<=\other
  2559. \catcode`\>=\other
  2560. \catcode`\+=\other
  2561. \def\normaldoublequote{"}
  2562. \def\normaltilde{~}
  2563. \def\normalcaret{^}
  2564. \def\normalunderscore{_}
  2565. \def\normalverticalbar{|}
  2566. \def\normalless{<}
  2567. \def\normalgreater{>}
  2568. \def\normalplus{+}
  2569. % This macro is used to make a character print one way in ttfont
  2570. % where it can probably just be output, and another way in other fonts,
  2571. % where something hairier probably needs to be done.
  2572. % #1 is what to print if we are indeed using \tt; #2 is what to print
  2573. % otherwise.  Since all the Computer Modern typewriter fonts have zero
  2574. % interword stretch (and shrink), and it is reasonable to expect all
  2575. % typewriter fonts to have this, we can check that font parameter.
  2576. \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
  2577. % Turn off all special characters except @
  2578. % (and those which the user can use as if they were ordinary).
  2579. % Most of these we simply print from the \tt font, but for some, we can
  2580. % use math or other variants that look better in normal text.
  2581. \catcode`\"=\active
  2582. \def\activedoublequote{{\tt \char '042}}
  2583. \let"=\activedoublequote
  2584. \catcode`\~=\active
  2585. \def~{{\tt \char '176}}
  2586. \chardef\hat=`\^
  2587. \catcode`\^=\active
  2588. \def^{{\tt \hat}}
  2589. \catcode`\_=\active
  2590. \def_{\ifusingtt\normalunderscore\_}
  2591. % Subroutine for the previous macro.
  2592. \def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}}
  2593. % \lvvmode is equivalent in function to \leavevmode.
  2594. % Using \leavevmode runs into trouble when written out to
  2595. % an index file due to the expansion of \leavevmode into ``\unhbox
  2596. % \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our
  2597. % magic tricks with @.
  2598. \def\lvvmode{\vbox to 0pt{}}
  2599. \catcode`\|=\active
  2600. \def|{{\tt \char '174}}
  2601. \chardef \less=`\<
  2602. \catcode`\<=\active
  2603. \def<{{\tt \less}}
  2604. \chardef \gtr=`\>
  2605. \catcode`\>=\active
  2606. \def>{{\tt \gtr}}
  2607. \catcode`\+=\active
  2608. \def+{{\tt \char 43}}
  2609. %\catcode 27=\active
  2610. %\def^^[{$\diamondsuit$}
  2611. % Used sometimes to turn off (effectively) the active characters
  2612. % even after parsing them.
  2613. \def\turnoffactive{\let"=\normaldoublequote
  2614. \let~=\normaltilde
  2615. \let^=\normalcaret
  2616. \let_=\normalunderscore
  2617. \let|=\normalverticalbar
  2618. \let<=\normalless
  2619. \let>=\normalgreater
  2620. \let+=\normalplus}
  2621. % Set up an active definition for =, but don't enable it most of the time.
  2622. {\catcode`\==\active
  2623. \global\def={{\tt \char 61}}}
  2624. \catcode`\@=0
  2625. % \rawbackslashxx output one backslash character in current font
  2626. \global\chardef\rawbackslashxx=`\\
  2627. %{\catcode`\\=\other
  2628. %@gdef@rawbackslashxx{\}}
  2629. % \rawbackslash redefines \ as input to do \rawbackslashxx.
  2630. {\catcode`\\=\active
  2631. @gdef@rawbackslash{@let\=@rawbackslashxx }}
  2632. % \normalbackslash outputs one backslash in fixed width font.
  2633. \def\normalbackslash{{\tt\rawbackslashxx}}
  2634. % Say @foo, not \foo, in error messages.
  2635. \escapechar=`\@
  2636. % \catcode 17=0   % Define control-q
  2637. \catcode`\\=\active
  2638. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  2639. % That is what \eatinput is for; after that, the `\' should revert to printing 
  2640. % a backslash.
  2641. @gdef@eatinput input texinfo{@fixbackslash}
  2642. @global@let\ = @eatinput
  2643. % On the other hand, perhaps the file did not have a `\input texinfo'. Then
  2644. % the first `\{ in the file would cause an error. This macro tries to fix 
  2645. % that, assuming it is called before the first `\' could plausibly occur.
  2646. @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi}
  2647. %% These look ok in all fonts, so just make them not special.  The @rm below
  2648. %% makes sure that the current font starts out as the newly loaded cmr10
  2649. @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
  2650. @textfonts
  2651. @c Local variables:
  2652. @c page-delimiter: "^\\\\message"
  2653. @c End:
  2654.